Skip to content

Commit b0c9b00

Browse files
fbuchlakjbelien
andauthored
style: convert string class names to constants (#1252)
* style: convert string class names to constants * style: fix php-cs-fixer --------- Co-authored-by: Jonathan Beliën <jbelien@users.noreply.github.com>
1 parent d076a8d commit b0c9b00

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/GeoIP2AdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class GeoIP2AdapterTest extends TestCase
3131
*/
3232
public static function setUpBeforeClass(): void
3333
{
34-
if (false === class_exists('\GeoIp2\Database\Reader')) {
34+
if (false === class_exists(\GeoIp2\Database\Reader::class)) {
3535
throw new \RuntimeException("The maxmind's lib 'geoip2/geoip2' is required to run this test.");
3636
}
3737
}
@@ -126,7 +126,7 @@ public function testReaderResponseIsJsonEncoded(): void
126126
*/
127127
protected function getGeoIP2ProviderMock()
128128
{
129-
$mock = $this->getMockBuilder('\GeoIp2\ProviderInterface')->getMock();
129+
$mock = $this->getMockBuilder(\GeoIp2\ProviderInterface::class)->getMock();
130130

131131
return $mock;
132132
}

Tests/GeoIP2Test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public function testGeocodeWithLocalhostIPv4(): void
6363
{
6464
$results = $this->provider->geocodeQuery(GeocodeQuery::create('127.0.0.1'));
6565

66-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
66+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
6767
$this->assertCount(1, $results);
6868

6969
/** @var Location $result */
7070
$result = $results->first();
71-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
71+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
7272
$this->assertEquals('localhost', $result->getLocality());
7373
$this->assertEquals('localhost', $result->getCountry()->getName());
7474
}
@@ -172,12 +172,12 @@ public function testRetrievingGeodata(string $address, string $adapterResponse,
172172

173173
$results = $provider->geocodeQuery(GeocodeQuery::create($address));
174174

175-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
175+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
176176
$this->assertCount(1, $results);
177177

178178
/** @var Location $result */
179179
$result = $results->first();
180-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
180+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
181181
if (isset($expectedGeodata['latitude'])) {
182182
$this->assertEquals($expectedGeodata['latitude'], $result->getCoordinates()->getLatitude());
183183
$this->assertEquals($expectedGeodata['longitude'], $result->getCoordinates()->getLongitude());

0 commit comments

Comments
 (0)