@@ -38,40 +38,37 @@ public function testGetName()
3838 $ this ->assertEquals ('mapbox ' , $ provider ->getName ());
3939 }
4040
41- /**
42- * @expectedException \Geocoder\Exception\UnsupportedOperation
43- */
4441 public function testGeocodeWithLocalhostIPv4 ()
4542 {
43+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
44+ $ this ->expectExceptionMessage ('The Mapbox provider does not support IP addresses, only street addresses. ' );
45+
4646 $ provider = new Mapbox ($ this ->getMockedHttpClient (), 'access_token ' );
4747 $ provider ->geocodeQuery (GeocodeQuery::create ('127.0.0.1 ' ));
4848 }
4949
50- /**
51- * @expectedException \Geocoder\Exception\UnsupportedOperation
52- * @expectedExceptionMessage The Mapbox provider does not support IP addresses, only street addresses.
53- */
5450 public function testGeocodeWithLocalhostIPv6 ()
5551 {
52+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
53+ $ this ->expectExceptionMessage ('The Mapbox provider does not support IP addresses, only street addresses. ' );
54+
5655 $ provider = new Mapbox ($ this ->getMockedHttpClient (), 'access_token ' );
5756 $ provider ->geocodeQuery (GeocodeQuery::create ('::1 ' ));
5857 }
5958
60- /**
61- * @expectedException \Geocoder\Exception\UnsupportedOperation
62- * @expectedExceptionMessage The Mapbox provider does not support IP addresses, only street addresses.
63- */
6459 public function testGeocodeWithRealIp ()
6560 {
61+ $ this ->expectException (\Geocoder \Exception \UnsupportedOperation::class);
62+ $ this ->expectExceptionMessage ('The Mapbox provider does not support IP addresses, only street addresses. ' );
63+
6664 $ provider = new Mapbox ($ this ->getHttpClient (), 'access_token ' );
6765 $ provider ->geocodeQuery (GeocodeQuery::create ('74.200.247.59 ' ));
6866 }
6967
70- /**
71- * @expectedException \Geocoder\Exception\QuotaExceeded
72- */
7368 public function testGeocodeWithQuotaExceeded ()
7469 {
70+ $ this ->expectException (\Geocoder \Exception \QuotaExceeded::class);
71+
7572 $ provider = new Mapbox ($ this ->getMockedHttpClient ('' , 429 ), 'access_token ' );
7673 $ provider ->geocodeQuery (GeocodeQuery::create ('10 avenue Gambetta, Paris, France ' ));
7774 }
@@ -152,11 +149,10 @@ public function testGeocodeWithRealAddress()
152149 $ this ->assertNull ($ result ->getTimezone ());
153150 }
154151
155- /**
156- * @expectedException \Geocoder\Exception\InvalidServerResponse
157- */
158152 public function testReverse ()
159153 {
154+ $ this ->expectException (\Geocoder \Exception \InvalidServerResponse::class);
155+
160156 $ provider = new Mapbox ($ this ->getMockedHttpClient (), 'access_token ' );
161157 $ provider ->reverseQuery (ReverseQuery::fromCoordinates (1 , 2 ));
162158 }
@@ -187,11 +183,10 @@ public function testReverseWithRealCoordinates()
187183 $ this ->assertEquals ('address.1085979616 ' , $ result ->getId ());
188184 }
189185
190- /**
191- * @expectedException \Geocoder\Exception\InvalidCredentials
192- */
193186 public function testGeocodeWithInvalidApiKey ()
194187 {
188+ $ this ->expectException (\Geocoder \Exception \InvalidCredentials::class);
189+
195190 $ provider = new Mapbox ($ this ->getMockedHttpClient ('' , 403 ), 'api_key ' );
196191 $ provider ->geocodeQuery (GeocodeQuery::create ('10 avenue Gambetta, Paris, France ' ));
197192 }
0 commit comments