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

31 lines
918 B
PHP
Raw Normal View History

2019-01-26 20:22:17 +01:00
<?php
2019-05-30 16:13:29 +02:00
namespace tests\Unit\Domain\Form;
2019-01-26 20:22:17 +01:00
use PHPUnit\Framework\TestCase;
2019-05-30 16:13:29 +02:00
use Infinito\Domain\Form\FormClassNameService;
use Infinito\Entity\Source\PureSource;
use Infinito\DBAL\Types\ActionType;
2019-01-26 20:22:17 +01:00
/**
* @author kevinfrantz
*/
class FormClassNameServiceTest extends TestCase
{
public function testGetName(): void
2019-01-26 20:22:17 +01:00
{
$entityClass = PureSource::class;
2019-01-26 20:22:17 +01:00
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass);
$this->assertEquals('Infinito\\Form\\Entity\\Source\\PureSourceType', $entityForm);
2019-01-26 20:22:17 +01:00
}
public function testWithType(): void
{
$entityClass = PureSource::class;
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass, ActionType::CREATE);
$this->assertEquals('Infinito\\Form\\Entity\\Source\\PureSourceCreateType', $entityForm);
}
2019-01-26 20:22:17 +01:00
}