Skip to content

Commit 63e91ad

Browse files
committed
Work on tests
1 parent 8d0f590 commit 63e91ad

4 files changed

Lines changed: 18 additions & 28 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
echo "Running unit tests";
5555
echo;
5656
echo;
57-
.Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --testsuite unit;
57+
.Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php --testsuite unit;
5858
fi
5959
6060
- >
@@ -63,7 +63,7 @@ jobs:
6363
echo "Running functional tests";
6464
echo;
6565
echo;
66-
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTestsBootstrap.php {}';
66+
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php {}';
6767
fi
6868
6969
- >
@@ -179,7 +179,7 @@ jobs:
179179
echo "Running unit tests";
180180
echo;
181181
echo;
182-
.Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --log-junit .Log/junit/unit_$VERSION.xml --coverage-php .Log/coverage/unit_$VERSION.cov --testsuite unit;
182+
.Build/bin/phpunit --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php --log-junit .Log/junit/unit_$VERSION.xml --coverage-php .Log/coverage/unit_$VERSION.cov --testsuite unit;
183183
fi
184184
185185
if [ -d "Tests/Functional" ]; then

Tests/Functional/Controller/AbstractExportControllerTestCase.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919

2020
use IchHabRecht\MaskExport\Controller\ExportController;
21-
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
2221
use PHPUnit\Framework\MockObject\MockBuilder;
2322
use Prophecy\Argument;
2423
use TYPO3\CMS\Core\Cache\CacheManager;
@@ -35,6 +34,7 @@
3534
use TYPO3\CMS\Extbase\Mvc\Response;
3635
use TYPO3\CMS\Extbase\Object\ObjectManager;
3736
use TYPO3\CMS\Fluid\View\TemplateView;
37+
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
3838

3939
abstract class AbstractExportControllerTestCase extends FunctionalTestCase
4040
{
@@ -43,10 +43,7 @@ abstract class AbstractExportControllerTestCase extends FunctionalTestCase
4343
*/
4444
protected $runTestInSeparateProcess = true;
4545

46-
/**
47-
* @var array
48-
*/
49-
protected $configurationToUseInTestInstance = [
46+
protected array $configurationToUseInTestInstance = [
5047
'EXTENSIONS' => [
5148
'mask' => [
5249
'json' => 'typo3conf/ext/mask_export/Tests/Functional/Fixtures/Configuration/mask-default.json',
@@ -58,22 +55,13 @@ abstract class AbstractExportControllerTestCase extends FunctionalTestCase
5855
],
5956
];
6057

61-
/**
62-
* @var array
63-
*/
64-
protected $coreExtensionsToLoad = [
58+
protected array $coreExtensionsToLoad = [
6559
'fluid_styled_content',
6660
];
6761

68-
/**
69-
* @var array
70-
*/
71-
protected $files = [];
62+
protected array $files = [];
7263

73-
/**
74-
* @var array
75-
*/
76-
protected $testExtensionsToLoad = [
64+
protected array $testExtensionsToLoad = [
7765
'typo3conf/ext/mask',
7866
'typo3conf/ext/mask_export',
7967
];
@@ -85,8 +73,6 @@ protected function setUp(): void
8573
{
8674
parent::setUp();
8775

88-
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
89-
9076
$request = new Request('IchHabRecht\\MaskExport\\Controller\\ExportController');
9177
$request->setControllerObjectName('IchHabRecht\\MaskExport\\Controller\\ExportController');
9278
$request->setControllerActionName('list');
@@ -100,7 +86,7 @@ protected function setUp(): void
10086
$response = new Response();
10187
}
10288

103-
$view = $objectManager->get(TemplateView::class);
89+
$view = GeneralUtility::makeInstance(TemplateView::class);
10490
$view->setLayoutRootPaths(['EXT:mask_export/Resources/Private/Layouts']);
10591
$view->setTemplateRootPaths(['EXT:mask_export/Tests/Functional/Fixtures/Templates']);
10692
if (method_exists(GeneralUtility::class, 'getContainer')) {
@@ -110,7 +96,7 @@ protected function setUp(): void
11096
GeneralUtility::addInstance(TemplateView::class, $view);
11197
}
11298

113-
$subject = $objectManager->get(ExportController::class);
99+
$subject = GeneralUtility::makeInstance(ExportController::class);
114100
$response = $subject->processRequest($request, $response) ?: $response;
115101

116102
$closure = \Closure::bind(function () use ($view) {

Tests/Unit/FileCollection/PhpFileCollectionTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
use IchHabRecht\MaskExport\Aggregate\PhpAwareInterface;
2121
use IchHabRecht\MaskExport\FileCollection\PhpFileCollection;
2222
use IchHabRecht\MaskExport\FlagResolver\PhpFileFlagResolver;
23-
use Nimut\TestingFramework\TestCase\UnitTestCase;
23+
use Prophecy\PhpUnit\ProphecyTrait;
2424
use TYPO3\CMS\Core\Service\DependencyOrderingService;
25+
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
2526

2627
class PhpFileCollectionTest extends UnitTestCase
2728
{
29+
use ProphecyTrait;
30+
2831
/**
2932
* @test
3033
*/
@@ -60,7 +63,7 @@ public function getFilesCombinesPhpFileFlags()
6063
$files = $phpFileCollection->getFiles();
6164

6265
$this->assertArrayHasKey('ext_tables.php', $files);
63-
$this->assertStringContainsString('defined(\'TYPO3_MODE\') || die();', $files['ext_tables.php']);
66+
$this->assertStringContainsString('defined(\'TYPO3\') || die();', $files['ext_tables.php']);
6467
$this->assertStringContainsString('call_user_func(static function () {', $files['ext_tables.php']);
6568
}
6669
}

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
},
2929
"require-dev": {
3030
"typo3/cms-fluid-styled-content": "^12.4",
31-
"nimut/testing-framework": "6.x-dev",
32-
"phpunit/phpunit": "^8.5"
31+
"typo3/testing-framework": "^7.0",
32+
"phpunit/phpunit": "^9.6",
33+
"phpspec/prophecy-phpunit": "^2.0"
3334
},
3435
"replace": {
3536
"typo3-ter/mask-export": "self.version"

0 commit comments

Comments
 (0)