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.

pull/5140/head
Yannick Warnier 2 years ago
parent 79b0f357d1
commit 8b34e721cd
  1. 8
      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);

Loading…
Cancel
Save