This commit is contained in:
2025-06-20 17:31:13 +02:00
parent 9158e33854
commit a38116cca4
65 changed files with 2298 additions and 2298 deletions

View File

@@ -39,33 +39,6 @@ final class HouseholdControllerTest extends WebTestCase
self::ensureKernelShutdown();
}
public static function generateValidHouseholdIds()
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$ids = $em->createQuery(
sprintf('SELECT DISTINCT h.id FROM %s h JOIN h.members m JOIN m.person p JOIN p.centerHistory ch JOIN ch.center c WHERE c.name = :center AND ch.endDate IS NULL', Household::class)
)
->setParameter('center', 'Center A')
->setMaxResults(100)
->getScalarResult();
if ([] === $ids) {
throw new \RuntimeException('no household ids with center "Center A"');
}
\shuffle($ids);
yield [\array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
self::ensureKernelShutdown();
}
/**
* @dataProvider generateValidHouseholdIds
*/
@@ -136,4 +109,31 @@ final class HouseholdControllerTest extends WebTestCase
$this->assertResponseIsSuccessful();
}
public static function generateValidHouseholdIds()
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$ids = $em->createQuery(
sprintf('SELECT DISTINCT h.id FROM %s h JOIN h.members m JOIN m.person p JOIN p.centerHistory ch JOIN ch.center c WHERE c.name = :center AND ch.endDate IS NULL', Household::class)
)
->setParameter('center', 'Center A')
->setMaxResults(100)
->getScalarResult();
if ([] === $ids) {
throw new \RuntimeException('no household ids with center "Center A"');
}
\shuffle($ids);
yield [\array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
yield [\array_pop($ids)['id']];
self::ensureKernelShutdown();
}
}