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

31 lines
897 B
PHP
Raw Normal View History

2019-01-26 20:22:17 +01:00
<?php
namespace tests\Unit\Domain\FormManagement;
use PHPUnit\Framework\TestCase;
use App\Domain\FormManagement\FormClassNameService;
use App\Entity\Source\PureSource;
use App\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);
2019-01-26 20:22:17 +01:00
$this->assertEquals('App\\Form\\Source\\PureSourceType', $entityForm);
}
public function testWithType(): void
{
$entityClass = PureSource::class;
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass, ActionType::CREATE);
$this->assertEquals('App\\Form\\Source\\PureSourceCreateType', $entityForm);
}
2019-01-26 20:22:17 +01:00
}