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.
36 lines
930 B
36 lines
930 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\Tests\CoreBundle\Repository;
|
|
|
|
use Chamilo\CoreBundle\Entity\Career;
|
|
use Chamilo\CoreBundle\Repository\CareerRepository;
|
|
use Chamilo\Tests\AbstractApiTest;
|
|
use Chamilo\Tests\ChamiloTestTrait;
|
|
|
|
class CareerRepositoryTest extends AbstractApiTest
|
|
{
|
|
use ChamiloTestTrait;
|
|
|
|
public function testCreate(): void
|
|
{
|
|
$em = $this->getEntityManager();
|
|
$repo = self::getContainer()->get(CareerRepository::class);
|
|
|
|
$career = (new Career())
|
|
->setTitle('Julio')
|
|
->setDescription('test')
|
|
->setStatus(1)
|
|
;
|
|
$this->assertHasNoEntityViolations($career);
|
|
$em->persist($career);
|
|
$em->flush();
|
|
|
|
$this->assertSame(1, $repo->count([]));
|
|
$this->assertSame('Julio', $career->getTitle());
|
|
$this->assertNotNull($career->getId());
|
|
}
|
|
}
|
|
|