Added max_visits field to short_urls

This commit is contained in:
Alejandro Celaya
2017-10-22 09:00:32 +02:00
parent 7f4678261e
commit af7c11665c
5 changed files with 89 additions and 14 deletions

View File

@@ -42,7 +42,7 @@ class VisitsTrackerTest extends TestCase
$this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal())->shouldBeCalledTimes(1);
$this->em->persist(Argument::any())->shouldBeCalledTimes(1);
$this->em->flush()->shouldBeCalledTimes(1);
$this->em->flush(Argument::type(Visit::class))->shouldBeCalledTimes(1);
$this->visitsTracker->track($shortCode, ServerRequestFactory::fromGlobals());
}
@@ -63,7 +63,7 @@ class VisitsTrackerTest extends TestCase
$visit = $args[0];
$test->assertEquals('4.3.2.1', $visit->getRemoteAddr());
})->shouldBeCalledTimes(1);
$this->em->flush()->shouldBeCalledTimes(1);
$this->em->flush(Argument::type(Visit::class))->shouldBeCalledTimes(1);
$this->visitsTracker->track($shortCode, ServerRequestFactory::fromGlobals(
['REMOTE_ADDR' => '1.2.3.4']