mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-09 00:04:59 +00:00
fix cs
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user