Skip to content

Commit af51b65

Browse files
authored
Enable PHP 8.0 support (#1102)
* Enable PHP 8.0 support * Add GitHub Actions * Upgrade php-http/curl-client + php-http/httplug * Upgrade PHPUnit * Drop PHP 7.2 support * Update GitHub Actions Remove PHP 7.2 * Update Travis CI Remove PHP 7.2 * Drop PHP 7.2 support
1 parent 13393f0 commit af51b65

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

Tests/IpInfoTest.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,20 @@ public function testGetName()
3131
$this->assertEquals('ip_info', $provider->getName());
3232
}
3333

34-
/**
35-
* @expectedException \Geocoder\Exception\UnsupportedOperation
36-
* @expectedExceptionMessage The IpInfo provider does not support street addresses, only IP addresses.
37-
*/
3834
public function testGeocodeWithRandomString()
3935
{
36+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
37+
$this->expectExceptionMessage('The IpInfo provider does not support street addresses, only IP addresses.');
38+
4039
$provider = new IpInfo($this->getMockedHttpClient());
4140
$provider->geocodeQuery(GeocodeQuery::create('foobar'));
4241
}
4342

44-
/**
45-
* @expectedException \Geocoder\Exception\UnsupportedOperation
46-
* @expectedExceptionMessage The IpInfo provider does not support street addresses, only IP addresses.
47-
*/
4843
public function testGeocodeWithAddress()
4944
{
45+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
46+
$this->expectExceptionMessage('The IpInfo provider does not support street addresses, only IP addresses.');
47+
5048
$provider = new IpInfo($this->getMockedHttpClient());
5149
$provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France'));
5250
}
@@ -79,11 +77,10 @@ public function provideLocalhostIps()
7977
yield ['::1'];
8078
}
8179

82-
/**
83-
* @expectedException \Geocoder\Exception\InvalidServerResponse
84-
*/
8580
public function testGeocodeWithRealIPv4GetsNullContent()
8681
{
82+
$this->expectException(\Geocoder\Exception\InvalidServerResponse::class);
83+
8784
$provider = new IpInfo($this->getMockedHttpClient());
8885
$provider->geocodeQuery(GeocodeQuery::create('74.125.45.100'));
8986
}
@@ -130,12 +127,11 @@ public function testGeocodeWithRealIPv6()
130127
$this->assertNull($result->getTimezone());
131128
}
132129

133-
/**
134-
* @expectedException \Geocoder\Exception\UnsupportedOperation
135-
* @expectedExceptionMessage The IpInfo provider is not able to do reverse geocoding.
136-
*/
137130
public function testReverse()
138131
{
132+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
133+
$this->expectExceptionMessage('The IpInfo provider is not able to do reverse geocoding.');
134+
139135
$provider = new IpInfo($this->getMockedHttpClient());
140136
$provider->reverseQuery(ReverseQuery::fromCoordinates(0, 0));
141137
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^7.2",
15+
"php": "^7.3 || ^8.0",
1616
"geocoder-php/common-http": "^4.0",
1717
"willdurand/geocoder": "^4.0"
1818
},

0 commit comments

Comments
 (0)