diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php index 3f427e811..6547b7280 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php @@ -529,8 +529,9 @@ class AccompanyingCourseApiControllerTest extends WebTestCase ->find($id); $periods = $person->getAccompanyingPeriods(); - yield [$periods[\array_rand($periods)], $socialIssues[\array_rand($socialIssues)] ]; - + if(sizeof($periods) > 0) { + yield [$periods[\array_rand($periods)], $socialIssues[\array_rand($socialIssues)] ]; + } $nbGenerated++; } }