mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Added orphan visits count to visits stats endpoint
This commit is contained in:
@@ -51,13 +51,15 @@ class VisitsStatsHelperTest extends TestCase
|
||||
public function returnsExpectedVisitsStats(int $expectedCount): void
|
||||
{
|
||||
$repo = $this->prophesize(VisitRepository::class);
|
||||
$count = $repo->countVisits(null)->willReturn($expectedCount);
|
||||
$count = $repo->countVisits(null)->willReturn($expectedCount * 3);
|
||||
$countOrphan = $repo->countOrphanVisits()->willReturn($expectedCount);
|
||||
$getRepo = $this->em->getRepository(Visit::class)->willReturn($repo->reveal());
|
||||
|
||||
$stats = $this->helper->getVisitsStats();
|
||||
|
||||
self::assertEquals(new VisitsStats($expectedCount), $stats);
|
||||
self::assertEquals(new VisitsStats($expectedCount * 3, $expectedCount), $stats);
|
||||
$count->shouldHaveBeenCalledOnce();
|
||||
$countOrphan->shouldHaveBeenCalledOnce();
|
||||
$getRepo->shouldHaveBeenCalledOnce();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user