@@ -48,12 +48,11 @@ public static function provideIps()
48
48
];
49
49
}
50
50
51
- /**
52
- * @expectedException \Geocoder\Exception\InvalidArgument
53
- * @expectedExceptionMessage Given IP2Location BIN file "NOT_EXIST.BIN" does not exist.
54
- */
55
51
public function testThrowIfNotExistBinaryFileGiven ()
56
52
{
53
+ $ this ->expectException (\Geocoder \Exception \InvalidArgument::class);
54
+ $ this ->expectExceptionMessage ('Given IP2Location BIN file "NOT_EXIST.BIN" does not exist. ' );
55
+
57
56
new IP2LocationBinary ('NOT_EXIST.BIN ' );
58
57
}
59
58
@@ -166,23 +165,21 @@ public function testGetName()
166
165
$ this ->assertEquals ('ip2location_binary ' , $ provider ->getName ());
167
166
}
168
167
169
- /**
170
- * @expectedException \Geocoder\Exception\UnsupportedOperation
171
- * @expectedExceptionMessage The IP2LocationBinary provider does not support street addresses.
172
- */
173
168
public function testThrowIfInvalidIpAddressGiven ()
174
169
{
170
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
171
+ $ this ->expectExceptionMessage ('The IP2LocationBinary provider does not support street addresses. ' );
172
+
175
173
$ provider = new IP2LocationBinary ($ this ->binaryFile );
176
174
177
175
$ provider ->geocodeQuery (GeocodeQuery::create ('invalidIp ' ));
178
176
}
179
177
180
- /**
181
- * @expectedException \Geocoder\Exception\UnsupportedOperation
182
- * @expectedExceptionMessage The IP2LocationBinary is not able to do reverse geocoding.
183
- */
184
178
public function testThrowOnReverseMethodUsage ()
185
179
{
180
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
181
+ $ this ->expectExceptionMessage ('The IP2LocationBinary is not able to do reverse geocoding. ' );
182
+
186
183
$ provider = new IP2LocationBinary ($ this ->binaryFile );
187
184
188
185
$ provider ->reverseQuery (ReverseQuery::fromCoordinates (0 , 0 ));
0 commit comments