pull/4020/head^2
Julio 3 years ago
parent 1e734c7a2b
commit 3264d98b77
  1. 8
      tests/CourseBundle/Repository/CLpItemRepositoryTest.php
  2. 2
      tests/CourseBundle/Repository/CLpRepositoryTest.php
  3. 4
      tests/CourseBundle/Repository/CQuizQuestionCategoryRepositoryTest.php
  4. 2
      tests/CourseBundle/Repository/CQuizRepositoryTest.php

@ -6,6 +6,7 @@ declare(strict_types=1);
namespace Chamilo\Tests\CourseBundle\Repository;
use Chamilo\CoreBundle\Repository\Node\CourseRepository;
use Chamilo\CourseBundle\Entity\CLp;
use Chamilo\CourseBundle\Entity\CLpItem;
use Chamilo\CourseBundle\Entity\CLpItemView;
@ -23,6 +24,7 @@ class CLpItemRepositoryTest extends AbstractApiTest
{
$lpRepo = self::getContainer()->get(CLpRepository::class);
$lpItemRepo = self::getContainer()->get(CLpItemRepository::class);
$courseRepo = self::getContainer()->get(CourseRepository::class);
$course = $this->createCourse('new');
$teacher = $this->createUser('teacher');
@ -117,5 +119,11 @@ class CLpItemRepositoryTest extends AbstractApiTest
$this->assertNotEmpty((string) $lpItem);
$this->assertSame(1, $lpRepo->count([]));
$this->assertSame(2, $lpItemRepo->count([]));
$lpRepo->delete($lp);
$this->assertSame(1, $courseRepo->count([]));
$this->assertSame(0, $lpRepo->count([]));
$this->assertSame(0, $lpItemRepo->count([]));
}
}

@ -150,8 +150,6 @@ class CLpRepositoryTest extends AbstractApiTest
public function testFindAllByCourse(): void
{
self::bootKernel();
$repo = self::getContainer()->get(CLpRepository::class);
$course = $this->createCourse('new');

@ -35,5 +35,9 @@ class CQuizQuestionCategoryRepositoryTest extends AbstractApiTest
$this->assertSame(0, $category->getQuestions()->count());
$this->assertSame(1, $categoryRepo->count([]));
$categoryRepo->delete($category);
$this->assertSame(0, $categoryRepo->count([]));
}
}

@ -92,7 +92,7 @@ class CQuizRepositoryTest extends AbstractApiTest
/** @var CQuiz $newExercise */
$newExercise = $repo->find($item->getIid());
$this->assertSame('exercise modified', $newExercise->getTitle());
$this->assertSame(0, $repo->count([]));
$this->assertSame(1, $repo->count([]));
}
public function testFindAllByCourse(): void

Loading…
Cancel
Save