In between commit solving tests for meta and template management

This commit is contained in:
Kevin Frantz
2019-01-06 13:13:24 +01:00
parent 6352e82ce1
commit 72d0a6ba95
11 changed files with 289 additions and 108 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Unit\Domain\FormManagement;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\Primitive\Name\SurnameSource;
use App\Domain\FormManagement\FormMetaInformationInterface;
use App\Domain\SourceManagement\SourceMetaInformation;
use App\Domain\FormManagement\FormMetaInformation;
use App\Domain\TemplateManagement\TemplatePathInformationInterface;
class FormMetaInformationTest extends TestCase
{
/**
* @var FormMetaInformationInterface
*/
private $formMeta;
public function setUp(): void
{
$sourceMeta = new SourceMetaInformation(new SurnameSource());
$this->formMeta = new FormMetaInformation($sourceMeta);
}
public function testGetFormClass(): void
{
$this->assertEquals('App\Form\Source\Primitive\Name\SurnameType', $this->formMeta->getFormClass());
}
public function testTemplateMeta(): void
{
$templatePathInformation = $this->formMeta->getTemplatePathInformation();
$this->assertInstanceOf(TemplatePathInformationInterface::class, $templatePathInformation);
$this->assertEquals('atom/form/source/primitive/name/surname.html.twig', $templatePathInformation->getAtomTemplatePath());
}
}