Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/tests/CourseBundle/Repository/CGroupCategoryRepositoryTes...

41 lines
1.0 KiB

4 years ago
<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\Tests\CourseBundle\Repository;
use Chamilo\CourseBundle\Entity\CGroupCategory;
use Chamilo\CourseBundle\Repository\CGroupCategoryRepository;
use Chamilo\Tests\AbstractApiTest;
use Chamilo\Tests\ChamiloTestTrait;
class CGroupCategoryRepositoryTest extends AbstractApiTest
{
use ChamiloTestTrait;
public function testCreate(): void
{
self::bootKernel();
$em = $this->getEntityManager();
4 years ago
$repo = self::getContainer()->get(CGroupCategoryRepository::class);
$course = $this->createCourse('new');
$teacher = $this->createUser('teacher');
$item = (new CGroupCategory())
->setTitle('category')
->setParent($course)
->setCreator($teacher)
->setMaxStudent(100)
;
$this->assertHasNoEntityViolations($item);
$em->persist($item);
$em->flush();
$this->assertSame(1, $repo->count([]));
}
}