mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 09:13:11 +08:00
Improved public API in Visit entity, reducing anemic model
This commit is contained in:
@@ -6,7 +6,9 @@ namespace ShlinkioTest\Shlink\Core\Service;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
||||
use Shlinkio\Shlink\Core\Entity\Visit;
|
||||
use Shlinkio\Shlink\Core\Model\Visitor;
|
||||
use Shlinkio\Shlink\Core\Repository\VisitRepository;
|
||||
use Shlinkio\Shlink\Core\Service\VisitService;
|
||||
|
||||
@@ -32,7 +34,7 @@ class VisitServiceTest extends TestCase
|
||||
*/
|
||||
public function saveVisitsPersistsProvidedVisit()
|
||||
{
|
||||
$visit = new Visit();
|
||||
$visit = new Visit(new ShortUrl(''), Visitor::emptyInstance());
|
||||
$this->em->persist($visit)->shouldBeCalledTimes(1);
|
||||
$this->em->flush()->shouldBeCalledTimes(1);
|
||||
$this->visitService->saveVisit($visit);
|
||||
|
||||
Reference in New Issue
Block a user