From 93b189b091cf7c286ac74a5607959c1b48b68ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 16 Oct 2023 14:43:46 +0200 Subject: [PATCH] DX: Fix HouseholdApiControllerTest.php --- .../Tests/Controller/HouseholdApiControllerTest.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php index 2e1c58c64..e98539de5 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php @@ -137,20 +137,17 @@ final class HouseholdApiControllerTest extends WebTestCase $qb = self::$container->get(EntityManagerInterface::class) ->createQueryBuilder(); - $period = $qb - ->select('ap') - ->from(AccompanyingPeriod::class, 'ap') + $personIds = $qb + ->select("p.id AS pid") + ->from(Person::class, 'p') ->where( - $qb->expr()->gte('SIZE(ap.participations)', 2) + $qb->expr()->gte('SIZE(p.accompanyingPeriodParticipations)', 2) ) ->getQuery() ->setMaxResults(1) ->getSingleResult(); - $person = $period->getParticipations() - ->first()->getPerson(); - - yield [$person->getId()]; + yield [$personIds['pid']]; self::ensureKernelShutdown(); }