diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php index 9e2bf622f..032bce7e7 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php @@ -139,16 +139,18 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase throw new \RuntimeException("no user found"); } - /** @var Person $person */ - [$person, $anotherPerson, $person2, $person3] = $this->entityManager + $persons = $this->entityManager ->createQuery("SELECT p FROM " . Person::class . " p JOIN p.centerCurrent current_center") ->setMaxResults(4) ->getResult(); - if (null === $person || null === $anotherPerson || null === $person2 || null === $person3) { + if (4 > count($persons)) { throw new \RuntimeException("no person found"); } + /** @var Person $person */ + [$person, $anotherPerson, $person2, $person3] = $persons; + $scopes = $this->scopeRepository->findAll(); if (3 > count($scopes)) { @@ -311,15 +313,17 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase } /** @var Person $person */ - [$person, $anotherPerson, $person2, $person3] = $this->entityManager + $persons = $this->entityManager ->createQuery("SELECT p FROM " . Person::class . " p ") ->setMaxResults(4) ->getResult(); - if (null === $person || null === $anotherPerson || null === $person2 || null === $person3) { + if (4 > count($persons)) { throw new \RuntimeException("no person found"); } + [$person, $anotherPerson, $person2, $person3] = $persons; + $scopes = $this->scopeRepository->findAll(); if (3 > count($scopes)) { @@ -439,15 +443,17 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase throw new \RuntimeException("no user found"); } - [$person, $anotherPerson, $person2, $person3] = $this->entityManager + $persons = $this->entityManager ->createQuery("SELECT p FROM " . Person::class . " p WHERE SIZE(p.accompanyingPeriodParticipations) = 0") ->setMaxResults(4) ->getResult(); - if (null === $person || null === $anotherPerson || null === $person2 || null === $person3) { + if (4 > count($persons)) { throw new \RuntimeException("no person found"); } + [$person, $anotherPerson, $person2, $person3] = $persons; + $scopes = $this->scopeRepository->findAll(); if (3 > count($scopes)) {