1717use Nimut \TestingFramework \Http \Response ;
1818use Nimut \TestingFramework \TestCase \FunctionalTestCase ;
1919use PHPUnit \Util \PHP \DefaultPhpProcess ;
20+ use SebastianBergmann \Template \Template ;
2021use TYPO3 \CMS \Core \Utility \GeneralUtility ;
2122
2223/**
@@ -29,16 +30,17 @@ abstract class AbstractRenderingTestCase extends FunctionalTestCase
2930 */
3031 protected $ testExtensionsToLoad = ['typo3conf/ext/typoscript_rendering ' ];
3132
32- /**
33- * @var string[]
34- */
35- protected $ coreExtensionsToLoad = ['fluid ' ];
33+ protected $ configurationToUseInTestInstance = [
34+ 'SYS ' => [
35+ 'encryptionKey ' => '42 ' ,
36+ ],
37+ ];
3638
37- public function setUp ()
39+ public function setUp (): void
3840 {
3941 parent ::setUp ();
4042 $ this ->importDataSet (__DIR__ . '/Fixtures/Database/pages.xml ' );
41- $ this ->setUpFrontendRootPage (1 , ['EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.ts ' ]);
43+ $ this ->setUpFrontendRootPage (1 , ['EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.typoscript ' ]);
4244 }
4345
4446 /* ***********************************************
@@ -55,6 +57,7 @@ public function setUp()
5557 protected function getRenderUrl ($ pageId , $ languageId , $ path )
5658 {
5759 $ requestArguments = ['id ' => $ pageId , 'L ' => $ languageId , 'path ' => $ path ];
60+
5861 return $ this ->fetchFrontendResponse ($ requestArguments )->getContent ();
5962 }
6063
@@ -77,7 +80,8 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
7780 'requestUrl ' => 'http://localhost ' . $ requestUrl ,
7881 ];
7982
80- $ template = new \Text_Template ('ntf://Frontend/Request.tpl ' );
83+ $ textTemplateClass = class_exists (Template::class) ? Template::class : \Text_Template::class;
84+ $ template = new $ textTemplateClass ('ntf://Frontend/Request.tpl ' );
8185 $ template ->setVar (
8286 [
8387 'arguments ' => var_export ($ arguments , true ),
@@ -86,11 +90,7 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
8690 ]
8791 );
8892
89- if (class_exists ('PHPUnit_Util_PHP ' )) {
90- $ php = \PHPUnit_Util_PHP::factory ();
91- } else {
92- $ php = DefaultPhpProcess::factory ();
93- }
93+ $ php = DefaultPhpProcess::factory ();
9494 $ response = $ php ->runJob ($ template ->render ());
9595 $ result = json_decode ($ response ['stdout ' ], true );
9696
0 commit comments