Skip to content

Commit 83ddad0

Browse files
committed
[Geoip] Upgrade tests (PHPUnit 9.5)
1 parent 329b348 commit 83ddad0

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/Provider/Geoip/Tests/GeoipTest.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ public function testGetName()
3838
$this->assertEquals('geoip', $provider->getName());
3939
}
4040

41-
/**
42-
* @expectedException \Geocoder\Exception\UnsupportedOperation
43-
* @expectedExceptionMessage The Geoip provider does not support street addresses, only IPv4 addresses.
44-
*/
4541
public function testGeocodeWithAddress()
4642
{
43+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
44+
$this->expectExceptionMessage('The Geoip provider does not support street addresses, only IPv4 addresses.');
45+
4746
$provider = new Geoip();
4847
$provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France'));
4948
}
@@ -68,32 +67,29 @@ public function testGeocodeWithLocalhostIPv4()
6867
$this->assertNotNull($result->getCountry());
6968
}
7069

71-
/**
72-
* @expectedException \Geocoder\Exception\UnsupportedOperation
73-
* @expectedExceptionMessage The Geoip provider does not support IPv6 addresses, only IPv4 addresses.
74-
*/
7570
public function testGeocodeWithLocalhostIPv6()
7671
{
72+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
73+
$this->expectExceptionMessage('The Geoip provider does not support IPv6 addresses, only IPv4 addresses.');
74+
7775
$provider = new Geoip();
7876
$provider->geocodeQuery(GeocodeQuery::create('::1'));
7977
}
8078

81-
/**
82-
* @expectedException \Geocoder\Exception\UnsupportedOperation
83-
* @expectedExceptionMessage The Geoip provider does not support IPv6 addresses, only IPv4 addresses.
84-
*/
8579
public function testGeocodeWithRealIPv6()
8680
{
81+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
82+
$this->expectExceptionMessage('The Geoip provider does not support IPv6 addresses, only IPv4 addresses.');
83+
8784
$provider = new Geoip();
8885
$provider->geocodeQuery(GeocodeQuery::create('::ffff:74.200.247.59'));
8986
}
9087

91-
/**
92-
* @expectedException \Geocoder\Exception\UnsupportedOperation
93-
* @expectedExceptionMessage The Geoip provider is not able to do reverse geocoding.
94-
*/
9588
public function testReverse()
9689
{
90+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
91+
$this->expectExceptionMessage('The Geoip provider is not able to do reverse geocoding.');
92+
9793
$provider = new Geoip();
9894
$provider->reverseQuery(ReverseQuery::fromCoordinates(1, 2));
9995
}

0 commit comments

Comments
 (0)