infinito/application/symfony/tests/Unit/Domain/FormManagement/FormClassNameServiceTest.php
2019-02-17 14:33:19 +01:00

31 lines
922 B
PHP

<?php
namespace tests\Unit\Domain\FormManagement;
use PHPUnit\Framework\TestCase;
use Infinito\Domain\FormManagement\FormClassNameService;
use Infinito\Entity\Source\PureSource;
use Infinito\DBAL\Types\ActionType;
/**
* @author kevinfrantz
*/
class FormClassNameServiceTest extends TestCase
{
public function testGetName(): void
{
$entityClass = PureSource::class;
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass);
$this->assertEquals('Infinito\\Form\\Source\\PureSourceType', $entityForm);
}
public function testWithType(): void
{
$entityClass = PureSource::class;
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass, ActionType::CREATE);
$this->assertEquals('Infinito\\Form\\Source\\PureSourceCreateType', $entityForm);
}
}