diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8922f604e..95a63ba45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,7 +212,7 @@ jobs: ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s composerUpdate${{matrix.composer-dependencies}} - name: Run unit tests run: | - ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -s unit + ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s unit strategy: fail-fast: false matrix: @@ -263,7 +263,7 @@ jobs: ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s composerUpdate${{matrix.composer-dependencies}} - name: Run functional tests run: | - ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -d ${{ matrix.dbms }} -s functional + ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -d ${{ matrix.dbms }} -s functional strategy: fail-fast: false matrix: diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 3f2a30359..2bb8b3bfe 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# shellcheck disable=SC2086,SC2046,SC2128,SC2178,SC2206 +# shellcheck disable=SC2086,SC2046,SC2128,SC2178,SC2206,SC2054 # Uncomment for debugging # set -x @@ -599,7 +599,7 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; functional) - COMMAND=(.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} "$@") + COMMAND=(.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS},not-core-${CORE_VERSION} "$@") case ${DBMS} in mariadb) echo "Using driver: ${DATABASE_DRIVER}" @@ -712,11 +712,11 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; unit) - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} .Build/bin/phpunit -c Build/phpunit/UnitTests.xml "$@" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} .Build/bin/phpunit -c Build/phpunit/UnitTests.xml --exclude-group not-core-${CORE_VERSION} "$@" SUITE_EXIT_CODE=$? ;; unitRandom) - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-random-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} .Build/bin/phpunit -c Build/phpunit/UnitTests.xml --order-by=random ${PHPUNIT_RANDOM} "$@" + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-random-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} .Build/bin/phpunit -c Build/phpunit/UnitTests.xml --exclude-group not-core-${CORE_VERSION} --order-by=random ${PHPUNIT_RANDOM} "$@" SUITE_EXIT_CODE=$? ;; update) diff --git a/Tests/Functional/Environment/ExtensionTest.php b/Tests/Functional/Environment/ExtensionTest.php deleted file mode 100644 index 3ca1b5752..000000000 --- a/Tests/Functional/Environment/ExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ -getMajorVersion(), self::ALLOWED_MAJOR_VERSIONS); + } + + #[Group('not-core-13.4')] + #[Test] + public function verifyCore12(): void + { + self::assertSame(12, (new Typo3Version())->getMajorVersion()); + } + + #[Group('not-core-12.4')] + #[Test] + public function verifyCore13(): void + { + self::assertSame(13, (new Typo3Version())->getMajorVersion()); + } +} diff --git a/Tests/Unit/Environment/ExtensionTest.php b/Tests/Unit/Environment/ExtensionTest.php deleted file mode 100644 index e2bc4bbc2..000000000 --- a/Tests/Unit/Environment/ExtensionTest.php +++ /dev/null @@ -1,25 +0,0 @@ -getMajorVersion(); - self::assertContains( - $currentVersion, - $supportedVersions - ); - } -} diff --git a/Tests/Unit/VersionCompatTest.php b/Tests/Unit/VersionCompatTest.php new file mode 100644 index 000000000..b3ffb4f99 --- /dev/null +++ b/Tests/Unit/VersionCompatTest.php @@ -0,0 +1,42 @@ +getMajorVersion(), self::ALLOWED_MAJOR_VERSIONS); + } + + #[Group('not-core-13.4')] + #[Test] + public function verifyCore12(): void + { + self::assertSame(12, (new Typo3Version())->getMajorVersion()); + } + + #[Group('not-core-12.4')] + #[Test] + public function verifyCore13(): void + { + self::assertSame(13, (new Typo3Version())->getMajorVersion()); + } +} diff --git a/composer.json b/composer.json index 35d2069a6..6105a28c5 100644 --- a/composer.json +++ b/composer.json @@ -123,7 +123,7 @@ "check:coverage:functional": [ "@check:tests:create-directories", "@coverage:create-directories", - "phpunit -c Build/phpunit/FunctionalTests.xml --coverage-php=build/coverage/functional.cov" + "phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-core-13.4 --coverage-php=build/coverage/functional.cov" ], "check:coverage:merge": [ "@coverage:create-directories", @@ -131,7 +131,7 @@ ], "check:coverage:unit": [ "@coverage:create-directories", - "phpunit -c Build/phpunit/UnitTests.xml --coverage-php=build/coverage/unit.cov" + "phpunit -c Build/phpunit/UnitTests.xml --exclude-group not-core-13.4 --coverage-php=build/coverage/unit.cov" ], "check:json:lint": "find . ! -path '*/.cache/*' ! -path '*/.Build/*' ! -path '*/node_modules/*' -name '*.json' | xargs -r php .Build/bin/jsonlint -q", "check:php": [