infinito/application/symfony/tests/Unit/Domain/FormManagement/FormClassNameServiceTest.php

31 lines
938 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\\Entity\\Source\\PureSourceType', $entityForm);
}
public function testWithType(): void
{
$entityClass = PureSource::class;
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass, ActionType::CREATE);
$this->assertEquals('Infinito\\Form\\Entity\\Source\\PureSourceCreateType', $entityForm);
}
}