1515
1616use Nimut \TestingFramework \Http \Response ;
1717use Nimut \TestingFramework \TestCase \FunctionalTestCase ;
18+ use PHPUnit \Util \PHP \DefaultPhpProcess ;
1819use TYPO3 \CMS \Core \Utility \GeneralUtility ;
1920
2021/**
@@ -32,23 +33,11 @@ abstract class AbstractRenderingTestCase extends FunctionalTestCase
3233 */
3334 protected $ coreExtensionsToLoad = array ('fluid ' );
3435
35- /**
36- * Avoid serlialization of the test system object
37- *
38- * @return array
39- */
40- public function __sleep ()
41- {
42- $ objectVars = get_object_vars ($ this );
43- unset($ objectVars ['testSystem ' ]);
44-
45- return $ objectVars ;
46- }
47-
4836 public function setUp ()
4937 {
5038 parent ::setUp ();
51- $ this ->setUpFrontendRootPage (1 );
39+ $ this ->importDataSet (__DIR__ . '/Fixtures/Database/pages.xml ' );
40+ $ this ->setUpFrontendRootPage (1 , array ('EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.ts ' ));
5241 }
5342
5443 /* ***********************************************
@@ -68,22 +57,6 @@ protected function getRenderUrl($pageId, $languageId, $path)
6857 return $ this ->fetchFrontendResponse ($ requestArguments )->getContent ();
6958 }
7059
71- /**
72- * @param int $pageId
73- * @param array $typoScriptFiles
74- *
75- * @return void
76- */
77- protected function setUpFrontendRootPage ($ pageId , array $ typoScriptFiles = array ())
78- {
79- $ page = array (
80- 'uid ' => $ pageId ,
81- 'title ' => 'root ' ,
82- );
83- $ this ->getDatabaseConnection ()->exec_INSERTquery ('pages ' , $ page );
84- parent ::setUpFrontendRootPage ($ pageId , array ('EXT:typoscript_rendering/Tests/Functional/Fixtures/Frontend/Basic.ts ' ));
85- }
86-
8760 /**
8861 * @param array $requestArguments
8962 * @param bool $failOnFailure
@@ -112,7 +85,11 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
11285 )
11386 );
11487
115- $ php = \PHPUnit_Util_PHP::factory ();
88+ if (class_exists ('PHPUnit_Util_PHP ' )) {
89+ $ php = \PHPUnit_Util_PHP::factory ();
90+ } else {
91+ $ php = DefaultPhpProcess::factory ();
92+ }
11693 $ response = $ php ->runJob ($ template ->render ());
11794 $ result = json_decode ($ response ['stdout ' ], true );
11895
0 commit comments