From 8b34e721cd7fdaf4503b6772bd1c8a2802516b12 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 2 Feb 2024 14:36:22 +0100 Subject: [PATCH] CI: PHPUnit: Change assertion around the cascade deletion of resources from a course on course deletion : these resources should not be deleted in cascade, as they can be used as independent resources afterwards. --- .../Repository/TrackEExerciseRepositoryTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/CoreBundle/Repository/TrackEExerciseRepositoryTest.php b/tests/CoreBundle/Repository/TrackEExerciseRepositoryTest.php index c214b129a9..bd853fe24c 100644 --- a/tests/CoreBundle/Repository/TrackEExerciseRepositoryTest.php +++ b/tests/CoreBundle/Repository/TrackEExerciseRepositoryTest.php @@ -86,9 +86,9 @@ class TrackEExerciseRepositoryTest extends AbstractApiTest $em->remove($course); $em->flush(); - $this->assertSame(0, $trackExerciseRepo->count([])); - $this->assertSame(0, $exerciseRepo->count([])); $this->assertSame(0, $courseRepo->count([])); + $this->assertSame(0, $trackExerciseRepo->count([])); + $this->assertSame(1, $exerciseRepo->count([])); } public function testCreateInSession(): void @@ -284,9 +284,9 @@ class TrackEExerciseRepositoryTest extends AbstractApiTest $em->remove($course); $em->flush(); - $this->assertSame(0, $courseRepo->count([])); - $this->assertSame(0, $exerciseRepo->count([])); $this->assertSame(0, $trackExerciseRepo->count([])); + $this->assertSame(1, $exerciseRepo->count([])); + $this->assertSame(0, $courseRepo->count([])); $teacher = $this->getUser('teacher'); $this->assertNotNull($teacher);