mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
31 lines
918 B
PHP
31 lines
918 B
PHP
<?php
|
|
|
|
namespace tests\Unit\Domain\Form;
|
|
|
|
use Infinito\DBAL\Types\ActionType;
|
|
use Infinito\Domain\Form\FormClassNameService;
|
|
use Infinito\Entity\Source\PureSource;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
}
|