mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
More useful error message when not enough people in database fixture
This commit is contained in:
parent
ae04172929
commit
abc067adae
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user