@@ -52,12 +52,11 @@ public static function provideIps()
52
52
];
53
53
}
54
54
55
- /**
56
- * @expectedException \Geocoder\Exception\InvalidArgument
57
- * @expectedExceptionMessage Given MaxMind dat file "not_exist.dat" does not exist.
58
- */
59
55
public function testThrowIfNotExistBinaryFileGiven ()
60
56
{
57
+ $ this ->expectException (\Geocoder \Exception \InvalidArgument::class);
58
+ $ this ->expectExceptionMessage ('Given MaxMind dat file "not_exist.dat" does not exist. ' );
59
+
61
60
new MaxMindBinary ('not_exist.dat ' );
62
61
}
63
62
@@ -162,34 +161,31 @@ public function testThrowIfIpAddressCouldNotBeLocated()
162
161
$ this ->assertEquals (0 , $ result ->count ());
163
162
}
164
163
165
- /**
166
- * @expectedException \Geocoder\Exception\UnsupportedOperation
167
- * @expectedExceptionMessage The MaxMindBinary provider does not support IPv6 addresses.
168
- */
169
164
public function testThrowIfIpAddressIsNotIpV4 ()
170
165
{
166
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
167
+ $ this ->expectExceptionMessage ('The MaxMindBinary provider does not support IPv6 addresses. ' );
168
+
171
169
$ provider = new MaxMindBinary ($ this ->binaryFile );
172
170
173
171
$ provider ->geocodeQuery (GeocodeQuery::create ('2002:5018:1818:0:0:0:0:0 ' ));
174
172
}
175
173
176
- /**
177
- * @expectedException \Geocoder\Exception\UnsupportedOperation
178
- * @expectedExceptionMessage The MaxMindBinary provider does not support street addresses.
179
- */
180
174
public function testThrowIfInvalidIpAddressGiven ()
181
175
{
176
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
177
+ $ this ->expectExceptionMessage ('The MaxMindBinary provider does not support street addresses. ' );
178
+
182
179
$ provider = new MaxMindBinary ($ this ->binaryFile );
183
180
184
181
$ provider ->geocodeQuery (GeocodeQuery::create ('invalidIp ' ));
185
182
}
186
183
187
- /**
188
- * @expectedException \Geocoder\Exception\UnsupportedOperation
189
- * @expectedExceptionMessage The MaxMindBinary is not able to do reverse geocoding.
190
- */
191
184
public function testThrowOnReverseMethodUsage ()
192
185
{
186
+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
187
+ $ this ->expectExceptionMessage ('The MaxMindBinary is not able to do reverse geocoding. ' );
188
+
193
189
$ provider = new MaxMindBinary ($ this ->binaryFile );
194
190
195
191
$ provider ->reverseQuery (ReverseQuery::fromCoordinates (0 , 0 ));
0 commit comments