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/CoreBundle/Repository/GroupRepositoryTest.php

35 lines
846 B

4 years ago
<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\Tests\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Group;
use Chamilo\CoreBundle\Repository\GroupRepository;
use Chamilo\Tests\AbstractApiTest;
use Chamilo\Tests\ChamiloTestTrait;
class GroupRepositoryTest extends AbstractApiTest
{
use ChamiloTestTrait;
public function testCreate(): void
{
self::bootKernel();
$em = $this->getManager();
4 years ago
$repo = self::getContainer()->get(GroupRepository::class);
$defaultGroups = $repo->count([]);
$item = (new Group('new_group'))
->setCode('new_group')
;
$this->assertHasNoEntityViolations($item);
$em->persist($item);
$em->flush();
$this->assertSame($defaultGroups + 1, $repo->count([]));
}
}