diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php index 7851c782d..4d45dc725 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php @@ -52,7 +52,8 @@ final class RelationshipApiControllerTest extends WebTestCase $countPersons = $em->createQueryBuilder() ->select('count(p)') ->from(Person::class, 'p') - ->join('p.center', 'c') + ->join('p.centerCurrent', 'center_current') + ->join('center_current.center', 'c') ->where('c.name LIKE :name') ->setParameter('name', 'Center A') ->getQuery() @@ -60,7 +61,8 @@ final class RelationshipApiControllerTest extends WebTestCase $person = $em->createQueryBuilder() ->select('p') ->from(Person::class, 'p') - ->join('p.center', 'c') + ->join('p.centerCurrent', 'center_current') + ->join('center_current.center', 'c') ->where('c.name LIKE :name') ->setParameter('name', 'Center A') ->getQuery() @@ -78,17 +80,20 @@ final class RelationshipApiControllerTest extends WebTestCase self::bootKernel(); $em = self::$container->get(EntityManagerInterface::class); $countPersons = $em->createQueryBuilder() - ->select('count(p)') + ->select('count(DISTINCT p)') ->from(Person::class, 'p') - ->join('p.center', 'c') + ->join('p.centerCurrent', 'center_current') + ->join('center_current.center', 'c') ->where('c.name LIKE :name') ->setParameter('name', 'Center A') ->getQuery() ->getSingleScalarResult(); + $persons = $em->createQueryBuilder() ->select('p') ->from(Person::class, 'p') - ->join('p.center', 'c') + ->join('p.centerCurrent', 'center_current') + ->join('center_current.center', 'c') ->where('c.name LIKE :name') ->setParameter('name', 'Center A') ->getQuery()