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.
39 lines
947 B
39 lines
947 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\Tests\CoreBundle\Repository;
|
|
|
|
use Chamilo\CoreBundle\Entity\Session;
|
|
use Chamilo\CoreBundle\Repository\SessionRepository;
|
|
use Chamilo\Tests\AbstractApiTest;
|
|
use Chamilo\Tests\ChamiloTestTrait;
|
|
|
|
class SessionRepositoryTest extends AbstractApiTest
|
|
{
|
|
use ChamiloTestTrait;
|
|
|
|
public function testCreate(): void
|
|
{
|
|
self::bootKernel();
|
|
|
|
$em = $this->getEntityManager();
|
|
$repo = self::getContainer()->get(SessionRepository::class);
|
|
|
|
$url = $this->getAccessUrl();
|
|
$coach = $this->createUser('coach');
|
|
|
|
$item = (new Session())
|
|
->setName('session 1')
|
|
->setGeneralCoach($coach)
|
|
->addAccessUrl($url)
|
|
;
|
|
$this->assertHasNoEntityViolations($item);
|
|
$em->persist($item);
|
|
$em->flush();
|
|
|
|
$this->assertSame(1, $repo->count([]));
|
|
}
|
|
}
|
|
|