mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 05:47:11 +02:00
deleted deprecated code
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace tests\Unit\Domain\TemplateManagement;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Domain\TemplateManagement\TemplatePathFormAndView;
|
||||
use Infinito\DBAL\Types\RESTResponseType;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class TemplatePathFormAndViewTest extends TestCase
|
||||
{
|
||||
const FILE = 'hello_world';
|
||||
|
||||
const FOLDER = 'folder';
|
||||
|
||||
const BASE_PATH = 'atom/view/'.self::FOLDER.'/'.self::FILE.'.';
|
||||
|
||||
/**
|
||||
* @var TemplatePathFormAndView
|
||||
*/
|
||||
private $templatePathFormAndView;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->templatePathFormAndView = new TemplatePathFormAndView(self::FILE, self::FOLDER);
|
||||
}
|
||||
|
||||
public function testTypeReload(): void
|
||||
{
|
||||
foreach (RESTResponseType::getValues() as $type) {
|
||||
$this->templatePathFormAndView->reloadType($type);
|
||||
$this->assertEquals(self::BASE_PATH.$type.'.twig', $this->templatePathFormAndView->getView()->getAtomTemplatePath());
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Domain\TemplateManagement;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Infinito\Entity\Source\Primitive\Name\FirstNameSource;
|
||||
use Infinito\Entity\Source\SourceInterface;
|
||||
use Infinito\Domain\TemplateManagement\TemplatePathInformation;
|
||||
use Infinito\Domain\SourceManagement\SourceMetaInformation;
|
||||
use Infinito\DBAL\Types\RESTResponseType;
|
||||
|
||||
class TemplatePathInformationTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var TemplatePathInformation
|
||||
*/
|
||||
private $templateMeta;
|
||||
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
private $source;
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param string $context
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getExpectedPath(string $type, string $context): string
|
||||
{
|
||||
return $context.'/entity/source/primitive/name/firstname.'.$type.'.twig';
|
||||
}
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->source = new FirstNameSource();
|
||||
$sourceMeta = new SourceMetaInformation($this->source);
|
||||
$folder = $sourceMeta->getNamespacePathMap()->getPath();
|
||||
$this->templateMeta = new TemplatePathInformation($sourceMeta->getPureName(), $folder, 'entity');
|
||||
}
|
||||
|
||||
public function testFrameTemplatePath(): void
|
||||
{
|
||||
$this->assertEquals($this->getExpectedPath('html', 'molecule'), $this->templateMeta->getMoleculeTemplatePath());
|
||||
}
|
||||
|
||||
public function testContentTemplatePath(): void
|
||||
{
|
||||
$this->assertEquals($this->getExpectedPath('html', 'atom'), $this->templateMeta->getAtomTemplatePath());
|
||||
}
|
||||
|
||||
public function testSetType(): void
|
||||
{
|
||||
foreach (RESTResponseType::getValues() as $type) {
|
||||
$this->templateMeta->reloadType($type);
|
||||
$this->assertEquals($this->getExpectedPath($type, 'atom'), $this->templateMeta->getAtomTemplatePath());
|
||||
$this->assertEquals($this->getExpectedPath($type, 'molecule'), $this->templateMeta->getMoleculeTemplatePath());
|
||||
$this->assertEquals($type, $this->templateMeta->getCrud());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user