mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Defined stricter model to represent one geo location
This commit is contained in:
@@ -11,6 +11,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\Common\Exception\WrongIpException;
|
||||
use Shlinkio\Shlink\Common\IpGeolocation\GeoLite2LocationResolver;
|
||||
use Shlinkio\Shlink\Common\IpGeolocation\Model\Location;
|
||||
|
||||
class GeoLite2LocationResolverTest extends TestCase
|
||||
{
|
||||
@@ -51,10 +52,8 @@ class GeoLite2LocationResolverTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function resolvedCityIsProperlyMapped()
|
||||
/** @test */
|
||||
public function resolvedCityIsProperlyMapped(): void
|
||||
{
|
||||
$ipAddress = '1.2.3.4';
|
||||
$city = new City([]);
|
||||
@@ -63,15 +62,7 @@ class GeoLite2LocationResolverTest extends TestCase
|
||||
|
||||
$result = $this->resolver->resolveIpLocation($ipAddress);
|
||||
|
||||
$this->assertEquals([
|
||||
'country_code' => '',
|
||||
'country_name' => '',
|
||||
'region_name' => '',
|
||||
'city' => '',
|
||||
'latitude' => '',
|
||||
'longitude' => '',
|
||||
'time_zone' => '',
|
||||
], $result);
|
||||
$this->assertEquals(Location::emptyInstance(), $result);
|
||||
$cityMethod->shouldHaveBeenCalledOnce();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user