Defined stricter model to represent one geo location

This commit is contained in:
Alejandro Celaya
2019-02-17 12:59:55 +01:00
parent 5c5dde48de
commit e2abe23895
19 changed files with 204 additions and 198 deletions

View File

@@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Common\IpGeolocation\Model\Location;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Entity\Visit;
use Shlinkio\Shlink\Core\Entity\VisitLocation;
@@ -31,10 +32,8 @@ class VisitServiceTest extends TestCase
$this->visitService = new VisitService($this->em->reveal());
}
/**
* @test
*/
public function locateVisitsIteratesAndLocatesUnlocatedVisits()
/** @test */
public function locateVisitsIteratesAndLocatesUnlocatedVisits(): void
{
$unlocatedVisits = [
[new Visit(new ShortUrl('foo'), Visitor::emptyInstance())],
@@ -53,7 +52,7 @@ class VisitServiceTest extends TestCase
});
$this->visitService->locateVisits(function () {
return [];
return Location::emptyInstance();
}, function () {
$args = func_get_args();