mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Updated ImportedLinksProcessor to support importing visits if provided
This commit is contained in:
@@ -17,7 +17,7 @@ class VisitLocationTest extends TestCase
|
||||
public function isEmptyReturnsTrueWhenAllValuesAreEmpty(array $args, bool $isEmpty): void
|
||||
{
|
||||
$payload = new Location(...$args);
|
||||
$location = new VisitLocation($payload);
|
||||
$location = VisitLocation::fromGeolocation($payload);
|
||||
|
||||
self::assertEquals($isEmpty, $location->isEmpty());
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class LocateVisitTest extends TestCase
|
||||
|
||||
($this->locateVisit)($event);
|
||||
|
||||
self::assertEquals($visit->getVisitLocation(), new VisitLocation(Location::emptyInstance()));
|
||||
self::assertEquals($visit->getVisitLocation(), VisitLocation::fromGeolocation(Location::emptyInstance()));
|
||||
$findVisit->shouldHaveBeenCalledOnce();
|
||||
$flush->shouldHaveBeenCalledOnce();
|
||||
$resolveIp->shouldNotHaveBeenCalled();
|
||||
@@ -204,7 +204,7 @@ class LocateVisitTest extends TestCase
|
||||
|
||||
($this->locateVisit)($event);
|
||||
|
||||
self::assertEquals($visit->getVisitLocation(), new VisitLocation($location));
|
||||
self::assertEquals($visit->getVisitLocation(), VisitLocation::fromGeolocation($location));
|
||||
$findVisit->shouldHaveBeenCalledOnce();
|
||||
$flush->shouldHaveBeenCalledOnce();
|
||||
$resolveIp->shouldHaveBeenCalledOnce();
|
||||
|
||||
@@ -68,7 +68,7 @@ class OrphanVisitDataTransformerTest extends TestCase
|
||||
->withHeader('Referer', 'referer')
|
||||
->withUri(new Uri('https://doma.in/foo/bar')),
|
||||
),
|
||||
)->locate($location = new VisitLocation(Location::emptyInstance())),
|
||||
)->locate($location = VisitLocation::fromGeolocation(Location::emptyInstance())),
|
||||
[
|
||||
'referer' => 'referer',
|
||||
'date' => $visit->getDate()->toAtomString(),
|
||||
|
||||
Reference in New Issue
Block a user