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.
34 lines
803 B
34 lines
803 B
![]()
4 years ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
/* For licensing terms, see /license.txt */
|
||
|
|
||
|
namespace Chamilo\Tests\CoreBundle\Repository;
|
||
|
|
||
|
use Chamilo\CoreBundle\Entity\Tool;
|
||
|
use Chamilo\CoreBundle\Repository\ToolRepository;
|
||
|
use Chamilo\Tests\AbstractApiTest;
|
||
|
use Chamilo\Tests\ChamiloTestTrait;
|
||
|
|
||
|
class ToolRepositoryTest extends AbstractApiTest
|
||
|
{
|
||
|
use ChamiloTestTrait;
|
||
|
|
||
|
public function testCreate(): void
|
||
|
{
|
||
|
$em = $this->getEntityManager();
|
||
|
$repo = self::getContainer()->get(ToolRepository::class);
|
||
|
$defaultCount = $repo->count([]);
|
||
|
|
||
|
$tool = (new Tool())
|
||
|
->setName('test')
|
||
|
;
|
||
|
$em->persist($tool);
|
||
|
$em->flush();
|
||
|
|
||
|
$this->assertSame($defaultCount + 1, $repo->count([]));
|
||
|
$this->assertSame('test', $tool->getName());
|
||
|
}
|
||
|
}
|