mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2025-02-09 22:03:50 +01:00

Compare commits

...

7 commits

Author SHA1 Message Date
Oliver Klee
1725b0361c Use an exact version of paratest 2025-01-04 14:26:55 +01:00
Oliver Klee
87742e2d0d Use a higher minimal version of paratest 2025-01-04 14:26:55 +01:00
Eike Starkmann
e0ceb64bb2 [FEATURE] use paratest in runTests.sh
Part of #1379
2025-01-04 14:26:55 +01:00
Eike Starkmann
20a7966e65 Revert "[TASK] run tests in separate processes"
This reverts commit 28892c988b075e57a6136d84f84c571191dea742.
2025-01-04 14:26:55 +01:00
Eike Starkmann
b83f017ad9 [TASK] run tests in separate processes
Part of  #1387
2025-01-04 14:26:55 +01:00
Eike Starkmann
435bff059e [FEATURE] Use paratest for composer script
This needs to be done for runTests.sh as well

Part of #1379
2025-01-04 14:26:55 +01:00
Eike Starkmann
45f9479e58
[TASK] Add functional tests for showAction (#1419)
Fixes #1228
2025-01-04 14:26:13 +01:00
5 changed files with 29 additions and 5 deletions

View file

@ -558,7 +558,7 @@ case ${TEST_SUITE} in
;;
functional)
[ -z "${TEST_FILE}" ] && TEST_FILE="Tests/Functional"
COMMAND=".Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} ${TEST_FILE}"
COMMAND=".Build/bin/paratest -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} ${TEST_FILE}"
case ${DBMS} in
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
@ -586,6 +586,7 @@ case ${TEST_SUITE} in
sqlite)
CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND}
echo "{CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG=\"${XDEBUG_CONFIG}\" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND}"
SUITE_EXIT_CODE=$?
;;
esac

View file

@ -1,3 +1,4 @@
"tt_content"
,"uid","pid","CType","header","list_type"
,1,1,"list","Tea index","tea_teaindex"
,2,3,"list","Tea show","tea_teashow"

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -2,3 +2,4 @@
,"uid","pid","title","slug"
,1,0,"Rootpage","/"
,2,1,"Storage","/storage"
,3,1,"Show","/show"

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -20,6 +20,14 @@ final class TeaControllerTest extends FunctionalTestCase
'typo3conf/ext/tea/Tests/Functional/Controller/Fixtures/Sites/' => 'typo3conf/sites',
];
protected array $configurationToUseInTestInstance = [
'FE' => [
'cacheHash' => [
'enforceValidation' => false,
],
],
];
protected function setUp(): void
{
parent::setUp();
@ -37,6 +45,8 @@ final class TeaControllerTest extends FunctionalTestCase
'EXT:tea/Tests/Functional/Controller/Fixtures/TypoScript/Setup/Rendering.typoscript',
],
]);
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/ContentElementTeaIndex.csv');
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/Teas.csv');
}
/**
@ -44,9 +54,6 @@ final class TeaControllerTest extends FunctionalTestCase
*/
public function indexActionRendersAllAvailableTeas(): void
{
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/ContentElementTeaIndex.csv');
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/Teas.csv');
$request = (new InternalRequest())->withPageId(1);
$html = (string)$this->executeFrontendSubRequest($request)->getBody();
@ -54,4 +61,17 @@ final class TeaControllerTest extends FunctionalTestCase
self::assertStringContainsString('Godesberger Burgtee', $html);
self::assertStringContainsString('Oolong', $html);
}
/**
* @test
*/
public function showActionRendersTheGivenTeas(): void
{
$request = (new InternalRequest())->withPageId(3)->withQueryParameters(['tx_tea_teashow[tea]' => 1]);
$html = (string)$this->executeFrontendSubRequest($request)->getBody();
self::assertStringContainsString('Godesberger Burgtee', $html);
self::assertStringNotContainsString('Oolong', $html);
}
}

View file

@ -47,6 +47,7 @@
"typo3/cms-frontend": "^11.5.41 || ^12.4.24"
},
"require-dev": {
"brianium/paratest": "6.11.1",
"ergebnis/composer-normalize": "2.45.0",
"friendsofphp/php-cs-fixer": "3.66.0",
"helmich/typo3-typoscript-lint": "3.1.1 || 3.2.1",
@ -166,7 +167,7 @@
"ci:tests:create-directories": "mkdir -p .Build/public/typo3temp/var/tests",
"ci:tests:functional": [
"@ci:tests:create-directories",
"find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \\\"Running functional test suite {}\\\"; .Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml {}';"
"paratest -c Build/phpunit/FunctionalTests.xml Tests/Functional"
],
"ci:tests:unit": "phpunit -c Build/phpunit/UnitTests.xml Tests/Unit",
"ci:typoscript:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript",