diff --git a/Neos.FluidAdaptor/Tests/Functional/View/Fixtures/View/StandaloneView.php b/Neos.FluidAdaptor/Tests/Functional/View/Fixtures/View/StandaloneView.php deleted file mode 100644 index 21a3ddefd9..0000000000 --- a/Neos.FluidAdaptor/Tests/Functional/View/Fixtures/View/StandaloneView.php +++ /dev/null @@ -1,40 +0,0 @@ -fileIdentifierPrefix = $fileIdentifierPrefix; - parent::__construct($request, $options); - } - - - protected function createIdentifierForFile($pathAndFilename, $prefix) - { - $prefix = $this->fileIdentifierPrefix . $prefix; - return parent::createIdentifierForFile($pathAndFilename, $prefix); - } -} diff --git a/Neos.FluidAdaptor/Tests/Functional/View/StandaloneViewTest.php b/Neos.FluidAdaptor/Tests/Functional/View/StandaloneViewTest.php index 7f3a7fb781..923b78f9d3 100644 --- a/Neos.FluidAdaptor/Tests/Functional/View/StandaloneViewTest.php +++ b/Neos.FluidAdaptor/Tests/Functional/View/StandaloneViewTest.php @@ -15,8 +15,8 @@ use Neos\Flow\Mvc\ActionRequest; use Neos\Flow\Tests\FunctionalTestCase; use Neos\FluidAdaptor\Core\ViewHelper\Exception\WrongEnctypeException; -use Neos\FluidAdaptor\Tests\Functional\View\Fixtures\View\StandaloneView; use Neos\FluidAdaptor\View\Exception\InvalidTemplateResourceException; +use Neos\FluidAdaptor\View\StandaloneView; use Psr\Http\Message\ServerRequestFactoryInterface; use TYPO3Fluid\Fluid\Core\Parser\UnknownNamespaceException; @@ -25,26 +25,6 @@ */ class StandaloneViewTest extends FunctionalTestCase { - /** - * @var string - */ - protected $standaloneViewNonce = '42'; - - /** - * Every testcase should run *twice*. First, it is run in *uncached* way, second, - * it is run *cached*. To make sure that the first run is always uncached, the - * $standaloneViewNonce is initialized to some random value which is used inside - * an overridden version of StandaloneView::createIdentifierForFile. - */ - public function runBare(): void - { - $this->standaloneViewNonce = uniqid('', true); - parent::runBare(); - $numberOfAssertions = $this->getNumAssertions(); - parent::runBare(); - $this->addToAssertionCount($numberOfAssertions); - } - /** * @test */ @@ -53,7 +33,7 @@ public function inlineTemplateIsEvaluatedCorrectly(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->assign('foo', 'bar'); $standaloneView->setTemplateSource('This is my cool {foo} template!'); @@ -70,7 +50,7 @@ public function renderSectionIsEvaluatedCorrectly(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->assign('foo', 'bar'); $standaloneView->setTemplateSource('Around stuff... test {foo} after it'); @@ -88,7 +68,7 @@ public function renderThrowsExceptionIfNeitherTemplateSourceNorTemplatePathAndFi $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->render(); } @@ -101,7 +81,7 @@ public function renderThrowsExceptionSpecifiedTemplatePathAndFilenameDoesNotExis $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/NonExistingTemplate.txt'); $standaloneView->render(); } @@ -115,7 +95,7 @@ public function renderThrowsExceptionIfWrongEnctypeIsSetForFormUpload(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithFormUpload.txt'); $standaloneView->render(); } @@ -129,7 +109,7 @@ public function renderThrowsExceptionIfSpecifiedTemplatePathAndFilenamePointsToA $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures'); $standaloneView->render(); } @@ -142,7 +122,7 @@ public function templatePathAndFilenameIsLoaded(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->assign('name', 'Karsten'); $standaloneView->assign('name', 'Robert'); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplate.txt'); @@ -157,7 +137,7 @@ public function templatePathAndFilenameIsLoaded(): void */ public function variablesAreEscapedByDefault(): void { - $standaloneView = new StandaloneView(null, $this->standaloneViewNonce); + $standaloneView = new StandaloneView(null); $standaloneView->assign('name', 'Sebastian '); $standaloneView->setTemplateSource('Hello {name}.'); @@ -171,7 +151,7 @@ public function variablesAreEscapedByDefault(): void */ public function variablesAreNotEscapedIfEscapingIsDisabled(): void { - $standaloneView = new StandaloneView(null, $this->standaloneViewNonce); + $standaloneView = new StandaloneView(null); $standaloneView->assign('name', 'Sebastian '); $standaloneView->setTemplateSource('{escapingEnabled=false}Hello {name}.'); @@ -185,7 +165,7 @@ public function variablesAreNotEscapedIfEscapingIsDisabled(): void */ public function variablesCanBeNested() { - $standaloneView = new StandaloneView(null, $this->standaloneViewNonce); + $standaloneView = new StandaloneView(null); $standaloneView->assign('type', 'thing'); $standaloneView->assign('flavor', 'yellow'); $standaloneView->assign('config', ['thing' => ['value' => ['yellow' => 'Okayish']]]); @@ -205,7 +185,7 @@ public function partialWithDefaultLocationIsUsedIfNoPartialPathIsSetExplicitly() $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('txt'); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithPartial.txt'); $expected = 'This is a test template. Hello Robert.'; @@ -222,7 +202,7 @@ public function explicitPartialPathIsUsed(): void $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('txt'); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithPartial.txt'); $standaloneView->setPartialRootPath(__DIR__ . '/Fixtures/SpecialPartialsDirectory'); @@ -240,7 +220,7 @@ public function layoutWithDefaultLocationIsUsedIfNoLayoutPathIsSetExplicitly(): $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('txt'); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithLayout.txt'); $expected = 'Hey HEY HO'; @@ -256,7 +236,7 @@ public function explicitLayoutPathIsUsed(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('txt'); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithLayout.txt'); $standaloneView->setLayoutRootPath(__DIR__ . '/Fixtures/SpecialLayouts'); @@ -274,7 +254,7 @@ public function viewThrowsExceptionWhenUnknownViewHelperIsCalled(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('txt'); - $standaloneView = new Fixtures\View\StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithUnknownViewHelper.txt'); $standaloneView->setLayoutRootPath(__DIR__ . '/Fixtures/SpecialLayouts'); @@ -289,7 +269,7 @@ public function xmlNamespacesCanBeIgnored(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('txt'); - $standaloneView = new Fixtures\View\StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithCustomNamespaces.txt'); $standaloneView->setLayoutRootPath(__DIR__ . '/Fixtures/SpecialLayouts'); @@ -312,7 +292,7 @@ public function interceptorsWorkInPartialRenderedInStandaloneSection(): void $actionRequest = ActionRequest::fromHttpRequest($httpRequest); $actionRequest->setFormat('html'); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->assign('hack', '

HACK

'); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/NestedRenderingConfiguration/TemplateWithSection.txt'); @@ -324,7 +304,7 @@ public function interceptorsWorkInPartialRenderedInStandaloneSection(): void $templateCache = $this->objectManager->get(CacheManager::class)->getCache('Fluid_TemplateCache'); $templateCache->remove($partialCacheIdentifier); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->assign('hack', '

HACK

'); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/NestedRenderingConfiguration/TemplateWithSection.txt'); @@ -366,7 +346,7 @@ public function formViewHelpersOutsideOfFormWork(): void $httpRequest = $this->objectManager->get(ServerRequestFactoryInterface::class)->createServerRequest('GET', 'http://localhost'); $actionRequest = ActionRequest::fromHttpRequest($httpRequest); - $standaloneView = new StandaloneView($actionRequest, $this->standaloneViewNonce); + $standaloneView = new StandaloneView($actionRequest); $standaloneView->assign('name', 'Karsten'); $standaloneView->assign('name', 'Robert'); $standaloneView->setTemplatePathAndFilename(__DIR__ . '/Fixtures/TestTemplateWithFormField.txt');