From 7fe2758291ffad8837032272b099fd59a080a127 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Mon, 8 Jan 2024 00:41:08 +0100 Subject: [PATCH] [TASK] Move the PHPUnit configuration files to `Configuration/` (#1108) The `Tests/` directory should only include test code, but not the configuration files. Fixes #1082 --- .gitattributes | 2 ++ .../Functional => Configuration}/FunctionalTests.xml | 2 +- {Tests/Unit => Configuration}/UnitTests.xml | 2 +- composer.json | 10 ++++++---- 4 files changed, 10 insertions(+), 6 deletions(-) rename {Tests/Functional => Configuration}/FunctionalTests.xml (94%) rename {Tests/Unit => Configuration}/UnitTests.xml (92%) diff --git a/.gitattributes b/.gitattributes index 0620665..50b024c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,8 @@ /.phpstorm.meta.php export-ignore /.prettierrc.js export-ignore /Build/ export-ignore +/Configuration/FunctionalTests.xml export-ignore +/Configuration/UnitTests.xml export-ignore /Tests/ export-ignore /package.json export-ignore /phive.xml export-ignore diff --git a/Tests/Functional/FunctionalTests.xml b/Configuration/FunctionalTests.xml similarity index 94% rename from Tests/Functional/FunctionalTests.xml rename to Configuration/FunctionalTests.xml index f2da77f..41d9fb0 100644 --- a/Tests/Functional/FunctionalTests.xml +++ b/Configuration/FunctionalTests.xml @@ -4,7 +4,7 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" backupGlobals="true" beStrictAboutTestsThatDoNotTestAnything="false" - bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php" + bootstrap="../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php" cacheResult="false" colors="true" convertDeprecationsToExceptions="true" diff --git a/Tests/Unit/UnitTests.xml b/Configuration/UnitTests.xml similarity index 92% rename from Tests/Unit/UnitTests.xml rename to Configuration/UnitTests.xml index 0e1fa6c..4eef49e 100644 --- a/Tests/Unit/UnitTests.xml +++ b/Configuration/UnitTests.xml @@ -4,7 +4,7 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" backupGlobals="true" beStrictAboutTestsThatDoNotTestAnything="false" - bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php" + bootstrap="../.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php" cacheResult="false" colors="true" convertDeprecationsToExceptions="true" diff --git a/composer.json b/composer.json index a215074..658278f 100644 --- a/composer.json +++ b/composer.json @@ -118,7 +118,7 @@ "ci:coverage:functional": [ "@ci:tests:create-directories", "@coverage:create-directories", - ".Build/bin/phpunit -c ./Tests/Functional/FunctionalTests.xml --whitelist Classes --coverage-php=.Build/coverage/functional.cov Tests/Functional" + ".Build/bin/phpunit -c ./Configuration/FunctionalTests.xml --whitelist Classes --coverage-php=.Build/coverage/functional.cov Tests/Functional" ], "ci:coverage:merge": [ "@coverage:create-directories", @@ -126,7 +126,7 @@ ], "ci:coverage:unit": [ "@coverage:create-directories", - ".Build/bin/phpunit -c ./Tests/Unit/UnitTests.xml --whitelist Classes --coverage-php=.Build/coverage/unit.cov Tests/Unit" + ".Build/bin/phpunit -c ./Configuration/UnitTests.xml --whitelist Classes --coverage-php=.Build/coverage/unit.cov Tests/Unit" ], "ci:json:lint": "find . ! -path '*/.cache/*' ! -path '*/.Build/*' ! -path '*/node_modules/*' -name '*.json' | xargs -r php .Build/bin/jsonlint -q", "ci:php": [ @@ -152,9 +152,9 @@ "ci:tests:create-directories": "mkdir -p .Build/Web/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 ./Tests/Functional/FunctionalTests.xml {}';" + "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/bin/phpunit -c ./Configuration/FunctionalTests.xml {}';" ], - "ci:tests:unit": ".Build/bin/phpunit -c ./Tests/Unit/UnitTests.xml Tests/Unit", + "ci:tests:unit": ".Build/bin/phpunit -c ./Configuration/UnitTests.xml Tests/Unit", "ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", "ci:xliff:lint": "php Build/bin/console lint:xliff Resources/Private/Language", "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -regextype egrep -regex '.*.ya?ml$' | xargs -r php ./.Build/bin/yaml-lint", @@ -190,6 +190,8 @@ "rm .gitignore", "rm .php-cs-fixer.php", "rm .prettierrc.js", + "rm Configuration/FunctionalTests.xml", + "rm Configuration/UnitTests.xml", "rm package.json", "rm phive.xml", "rm phpcs.xml",