Skip to content

Commit d6f99c4

Browse files
committed
Use nimut/testing-framework
1 parent a7e4bc8 commit d6f99c4

5 files changed

Lines changed: 26 additions & 19 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ script:
5353
- >
5454
echo;
5555
echo "Running unit tests";
56-
.Build/bin/phpunit -c .Build/vendor/typo3/cms/typo3/sysext/core/Build/UnitTests.xml Tests/Unit/
56+
.Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit/
5757
5858
- >
5959
echo;
@@ -66,7 +66,7 @@ script:
6666
export typo3DatabaseHost="localhost";
6767
export typo3DatabaseUsername="root";
6868
export typo3DatabasePassword="";
69-
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit -c .Build/vendor/typo3/cms/typo3/sysext/core/Build/FunctionalTests.xml {}'
69+
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml {}'
7070
7171
after_script:
7272
- >

Tests/Functional/AbstractRenderingTestCase.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*
1414
*/
1515

16-
use TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Response;
17-
use TYPO3\CMS\Core\Tests\FunctionalTestCase;
16+
use Nimut\TestingFramework\Http\Response;
17+
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
1818
use TYPO3\CMS\Core\Utility\GeneralUtility;
1919

2020
/**
@@ -32,6 +32,19 @@ abstract class AbstractRenderingTestCase extends FunctionalTestCase
3232
*/
3333
protected $coreExtensionsToLoad = array('fluid');
3434

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+
3548
public function setUp()
3649
{
3750
parent::setUp();
@@ -85,21 +98,17 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
8598
$requestUrl = '/?' . GeneralUtility::implodeArrayForUrl('', $requestArguments);
8699
}
87100

88-
if (property_exists($this, 'instancePath')) {
89-
$instancePath = $this->instancePath;
90-
} else {
91-
$instancePath = ORIGINAL_ROOT . 'typo3temp/functional-' . substr(sha1(get_class($this)), 0, 7);
92-
}
93101
$arguments = array(
94-
'documentRoot' => $instancePath,
102+
'documentRoot' => $this->getInstancePath(),
95103
'requestUrl' => 'http://localhost' . $requestUrl,
96104
);
97105

98-
$template = new \Text_Template(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/request.tpl');
106+
$template = new \Text_Template('ntf://Frontend/Request.tpl');
99107
$template->setVar(
100108
array(
101109
'arguments' => var_export($arguments, true),
102110
'originalRoot' => ORIGINAL_ROOT,
111+
'ntfRoot' => __DIR__ . '/../../.Build/vendor/nimut/testing-framework/',
103112
)
104113
);
105114

@@ -108,7 +117,7 @@ protected function fetchFrontendResponse(array $requestArguments, $failOnFailure
108117
$result = json_decode($response['stdout'], true);
109118

110119
if ($result === null) {
111-
$this->fail('Frontend Response is empty');
120+
$this->fail('Frontend Response is empty: ' . $response['stdout'] . $response['stderr']);
112121
}
113122

114123
if ($failOnFailure && $result['status'] === Response::STATUS_Failure) {

Tests/Unit/Configuration/RecordRenderingConfigurationBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use Helhum\TyposcriptRendering\Configuration\RecordRenderingConfigurationBuilder;
1717
use Helhum\TyposcriptRendering\Renderer\RenderingContext;
18-
use TYPO3\CMS\Core\Tests\UnitTestCase;
18+
use Nimut\TestingFramework\TestCase\UnitTestCase;
1919
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
2020

2121
/**

Tests/Unit/Renderer/RecordRendererTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Helhum\TyposcriptRendering\Mvc\Request;
1717
use Helhum\TyposcriptRendering\Renderer\RecordRenderer;
1818
use Helhum\TyposcriptRendering\Renderer\RenderingContext;
19-
use TYPO3\CMS\Core\Tests\UnitTestCase;
19+
use Nimut\TestingFramework\TestCase\UnitTestCase;
2020
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
2121

2222
/**

composer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,16 @@
2525
"typo3/cms-core": "^6.2 || ^7.6 || ^8.0"
2626
},
2727
"require-dev": {
28-
"mikey179/vfsStream": "~1.6.0",
29-
"phpunit/phpunit": "~4.8.0"
28+
"nimut/testing-framework": "^1.0"
3029
},
3130
"autoload": {
3231
"psr-4": {
33-
"Helhum\\TyposcriptRendering\\": "Classes"
32+
"Helhum\\TyposcriptRendering\\": "Classes/"
3433
}
3534
},
3635
"autoload-dev": {
3736
"psr-4": {
38-
"Helhum\\TyposcriptRendering\\Tests\\": "Tests",
39-
"TYPO3\\CMS\\Core\\Tests\\": ".Build/vendor/typo3/cms/typo3/sysext/core/Tests/"
37+
"Helhum\\TyposcriptRendering\\Tests\\": "Tests/"
4038
}
4139
},
4240
"replace": {

0 commit comments

Comments
 (0)