diff --git a/tests/Functional/Core/Rendering/NamespaceInheritanceTest.php b/tests/Functional/Core/Rendering/NamespaceInheritanceTest.php index 2d003342c..a91067ff2 100644 --- a/tests/Functional/Core/Rendering/NamespaceInheritanceTest.php +++ b/tests/Functional/Core/Rendering/NamespaceInheritanceTest.php @@ -21,25 +21,25 @@ public static function namespacesAreInheritedToLayoutAndPartialsDataProvider(): { return [ 'namespace provided via php api' => [ - '', + '', ['test' => 'TYPO3Fluid\\Fluid\\Tests\\Functional\\Fixtures\\ViewHelpers'], [], ], // @todo this should probably not work 'namespace provided to layout and partials via inline namespace declaration in template' => [ - '{namespace test=TYPO3Fluid\\Fluid\\Tests\\Functional\\Fixtures\\ViewHelpers}', + '{namespace test=TYPO3Fluid\\Fluid\\Tests\\Functional\\Fixtures\\ViewHelpers}', [], [], ], // @todo this should probably not work 'namespace provided to layout and partials via xml namespace declaration in template' => [ - '', + '', [], [], ], // @todo this should probably not work 'namespace inherited from template to dynamic layout' => [ - '', + '', [], ['myLayout' => 'NamespaceInheritanceLayout'], ], @@ -50,7 +50,7 @@ public static function namespacesAreInheritedToLayoutAndPartialsDataProvider(): #[DataProvider('namespacesAreInheritedToLayoutAndPartialsDataProvider')] public function namespacesAreInheritedToLayoutAndPartials(string $source, array $predefinedNamespaces, array $variables): void { - $expectedResult = '
' . "\n\n" . '
' . "\n\n" . '
' . "\n\n" . '
' . "\n\n"; + $expectedResult = "\n" . '
' . "\n\n" . '
' . "\n\n\n\n" . '
' . "\n\n" . '
' . "\n\n"; // Uncached $view = new TemplateView(); @@ -62,15 +62,7 @@ public function namespacesAreInheritedToLayoutAndPartials(string $source, array $view->getRenderingContext()->getTemplatePaths()->setPartialRootPaths([__DIR__ . '/../../Fixtures/Partials/']); self::assertSame($expectedResult, $view->render()); - // Cached - $view = new TemplateView(); - $view->getRenderingContext()->setCache(self::$cache); - $view->getRenderingContext()->getViewHelperResolver()->addNamespaces($predefinedNamespaces); - $view->assignMultiple($variables); - $view->getRenderingContext()->getTemplatePaths()->setTemplateSource($source); - $view->getRenderingContext()->getTemplatePaths()->setLayoutRootPaths([__DIR__ . '/../../Fixtures/Layouts/']); - $view->getRenderingContext()->getTemplatePaths()->setPartialRootPaths([__DIR__ . '/../../Fixtures/Partials/']); - self::assertSame($expectedResult, $view->render()); + // @todo Cached state is currently not relevant here, since caching needs to be disabled for all affected templates to get robust testing results } public static function namespaceDefinedInParentNotValidInChildrenDataProvider(): array diff --git a/tests/Functional/Fixtures/Layouts/NamespaceInheritanceLayout.html b/tests/Functional/Fixtures/Layouts/NamespaceInheritanceLayout.html index e48e6dc43..011571821 100644 --- a/tests/Functional/Fixtures/Layouts/NamespaceInheritanceLayout.html +++ b/tests/Functional/Fixtures/Layouts/NamespaceInheritanceLayout.html @@ -1,3 +1,4 @@ + diff --git a/tests/Functional/Fixtures/Partials/NamespaceInheritanceNestedPartial.html b/tests/Functional/Fixtures/Partials/NamespaceInheritanceNestedPartial.html index a3a827d82..b18095ef9 100644 --- a/tests/Functional/Fixtures/Partials/NamespaceInheritanceNestedPartial.html +++ b/tests/Functional/Fixtures/Partials/NamespaceInheritanceNestedPartial.html @@ -1 +1,2 @@ + diff --git a/tests/Functional/Fixtures/Partials/NamespaceInheritancePartial.html b/tests/Functional/Fixtures/Partials/NamespaceInheritancePartial.html index 78004768c..f90621092 100644 --- a/tests/Functional/Fixtures/Partials/NamespaceInheritancePartial.html +++ b/tests/Functional/Fixtures/Partials/NamespaceInheritancePartial.html @@ -1,2 +1,3 @@ +