mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 00:47:25 -06:00
Fix LocateVisitTest
This commit is contained in:
parent
bd5d3cb6fa
commit
c03eea789c
@ -168,7 +168,9 @@ class LocateVisitTest extends TestCase
|
||||
$location,
|
||||
);
|
||||
|
||||
$this->eventDispatcher->expects($this->once())->method('dispatch')->with(new VisitLocated('123'));
|
||||
$this->eventDispatcher->expects($this->once())->method('dispatch')->with(
|
||||
new VisitLocated('123', $originalIpAddress),
|
||||
);
|
||||
$this->logger->expects($this->never())->method('warning');
|
||||
|
||||
($this->locateVisit)($event);
|
||||
|
@ -160,13 +160,10 @@ class SendVisitToMatomoTest extends TestCase
|
||||
$visitId = '123';
|
||||
$e = new Exception('Error!');
|
||||
|
||||
$tracker = $this->createMock(MatomoTracker::class);
|
||||
$tracker->expects($this->once())->method('setUrl')->willThrowException($e);
|
||||
|
||||
$this->em->expects($this->once())->method('find')->with(Visit::class, $visitId)->willReturn(
|
||||
$this->createMock(Visit::class),
|
||||
);
|
||||
$this->trackerBuilder->expects($this->once())->method('buildMatomoTracker')->willReturn($tracker);
|
||||
$this->trackerBuilder->expects($this->once())->method('buildMatomoTracker')->willThrowException($e);
|
||||
$this->logger->expects($this->never())->method('warning');
|
||||
$this->logger->expects($this->once())->method('error')->with(
|
||||
'An error occurred while trying to send visit to Matomo. {e}',
|
||||
|
Loading…
Reference in New Issue
Block a user