@@ -38,12 +38,11 @@ public function testGetName()
38
38
$ this ->assertEquals ('geoip ' , $ provider ->getName ());
39
39
}
40
40
41
- /**
42
- * @expectedException \Geocoder\Exception\UnsupportedOperation
43
- * @expectedExceptionMessage The Geoip provider does not support street addresses, only IPv4 addresses.
44
- */
45
41
public function testGeocodeWithAddress ()
46
42
{
43
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
44
+ $ this ->expectExceptionMessage ('The Geoip provider does not support street addresses, only IPv4 addresses. ' );
45
+
47
46
$ provider = new Geoip ();
48
47
$ provider ->geocodeQuery (GeocodeQuery::create ('10 avenue Gambetta, Paris, France ' ));
49
48
}
@@ -68,32 +67,29 @@ public function testGeocodeWithLocalhostIPv4()
68
67
$ this ->assertNotNull ($ result ->getCountry ());
69
68
}
70
69
71
- /**
72
- * @expectedException \Geocoder\Exception\UnsupportedOperation
73
- * @expectedExceptionMessage The Geoip provider does not support IPv6 addresses, only IPv4 addresses.
74
- */
75
70
public function testGeocodeWithLocalhostIPv6 ()
76
71
{
72
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
73
+ $ this ->expectExceptionMessage ('The Geoip provider does not support IPv6 addresses, only IPv4 addresses. ' );
74
+
77
75
$ provider = new Geoip ();
78
76
$ provider ->geocodeQuery (GeocodeQuery::create ('::1 ' ));
79
77
}
80
78
81
- /**
82
- * @expectedException \Geocoder\Exception\UnsupportedOperation
83
- * @expectedExceptionMessage The Geoip provider does not support IPv6 addresses, only IPv4 addresses.
84
- */
85
79
public function testGeocodeWithRealIPv6 ()
86
80
{
81
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
82
+ $ this ->expectExceptionMessage ('The Geoip provider does not support IPv6 addresses, only IPv4 addresses. ' );
83
+
87
84
$ provider = new Geoip ();
88
85
$ provider ->geocodeQuery (GeocodeQuery::create ('::ffff:74.200.247.59 ' ));
89
86
}
90
87
91
- /**
92
- * @expectedException \Geocoder\Exception\UnsupportedOperation
93
- * @expectedExceptionMessage The Geoip provider is not able to do reverse geocoding.
94
- */
95
88
public function testReverse ()
96
89
{
90
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
91
+ $ this ->expectExceptionMessage ('The Geoip provider is not able to do reverse geocoding. ' );
92
+
97
93
$ provider = new Geoip ();
98
94
$ provider ->reverseQuery (ReverseQuery::fromCoordinates (1 , 2 ));
99
95
}
0 commit comments