Merge branch 'bootstrap-serializer' into fix-tests-main

This commit is contained in:
Julien Fastré 2021-04-28 10:29:53 +02:00
commit 86d13410c3
2 changed files with 1 additions and 21 deletions

View File

@ -39,23 +39,4 @@ class AccompanyingPeriodRepository extends ServiceEntityRepository
{
parent::__construct($registry, AccompanyingPeriod::class);
}
/**
* @return array|AccompanyingPeriod[]
*/
public function findByPerson(Person $person, $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->createQueryBuilder('ap');
$qb->join('ap.participations', 'participation')
->where($qb->expr()->eq('participation.person', ':person'))
// ->orderBy($orderBy)
// ->setMaxResults($limit)
//->setFirstResult($offset ?? 0)
->setParameter('person', $person)
;
return $qb->getQuery()->getResult();
}
}

View File

@ -164,8 +164,7 @@ class AccompanyingCourseControllerTest extends WebTestCase
$person = $em->getRepository(Person::class)
->find($id);
$periods = $em->getRepository(AccompanyingPeriod::class)
->findByPerson($person);
$periods = $person->getAccompanyingPeriods();
yield [\array_pop($personIds)["id"], $periods[\array_rand($periods)] ];