Improved VisitsStatsHelperTest covering visitsForDomain method

This commit is contained in:
Alejandro Celaya
2022-04-23 11:02:51 +02:00
parent 9a0e5ea626
commit 99b4f9f4dd
2 changed files with 67 additions and 1 deletions

View File

@@ -97,7 +97,7 @@ class VisitsStatsHelper implements VisitsStatsHelperInterface
{
/** @var DomainRepository $domainRepo */
$domainRepo = $this->em->getRepository(Domain::class);
if ($domain !== 'DEFAULT' && $domainRepo->count(['authority' => $domain]) === 0) {
if ($domain !== 'DEFAULT' && ! $domainRepo->domainExists($domain, $apiKey)) {
throw DomainNotFoundException::fromAuthority($domain);
}