Implemented type for FormClassNameService and solved reference bugs

This commit is contained in:
Kevin Frantz
2019-02-03 15:40:44 +01:00
parent ed3062a203
commit 22c9a92853
4 changed files with 24 additions and 5 deletions

View File

@@ -5,17 +5,26 @@ namespace tests\Unit\Domain\FormManagement;
use PHPUnit\Framework\TestCase;
use App\Domain\FormManagement\FormClassNameService;
use App\Entity\Source\PureSource;
use App\DBAL\Types\ActionType;
/**
* @author kevinfrantz
*/
class FormClassNameServiceTest extends TestCase
{
public function testGetName()
public function testGetName(): void
{
$entityClass = PureSource::class;
$formNameService = new FormClassNameService();
$entityForm = $formNameService->getClass($entityClass);
$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);
}
}