diff --git a/.ddev/commands/web/update-to b/.ddev/commands/web/update-to new file mode 100755 index 0000000..5ed89e3 --- /dev/null +++ b/.ddev/commands/web/update-to @@ -0,0 +1,8 @@ +#!/bin/bash + +## Description: Local TYPO3 version switcher +## Usage: update-to {11} +## Example: "ddev update-to 11" +## ProjectTypes: typo3 + +bash ./Build/Scripts/composer-for-core-version.sh $* diff --git a/.ddev/config.yaml b/.ddev/config.yaml index e89ab04..0293b05 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -3,7 +3,7 @@ type: typo3 docroot: .Build/Web # Using 8.1 instead of 8.0 to use helhum/typo3-console 8. # Version 7 throws an error during install:setup script. -php_version: "8.1" +php_version: "7.4" webserver_type: nginx-fpm router_http_port: "80" router_https_port: "443" diff --git a/.github/workflows/testcore11.yml b/.github/workflows/testcore10.yml similarity index 78% rename from .github/workflows/testcore11.yml rename to .github/workflows/testcore10.yml index 72be5bf..e40cff0 100644 --- a/.github/workflows/testcore11.yml +++ b/.github/workflows/testcore10.yml @@ -1,43 +1,43 @@ -name: tests core 11 +name: tests core 10 on: pull_request: jobs: code-quality: - name: "code quality with core v11" + name: "code quality with core v10" runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - php-version: [ '8.1'] + php-version: [ '7.4'] steps: - name: "Checkout" uses: actions/checkout@v3 - - name: "Prepare dependencies for TYPO3 v11" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s composerUpdate" + - name: "Prepare dependencies for TYPO3 v10" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s composerUpdate" - name: "Run TypoScript lint" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s lintTypoScript" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s lintTypoScript" - name: "Run PHP lint" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s lintPhp" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s lintPhp" - name: "Validate CGL" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s cgl" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s cgl" - name: "Ensure UTF-8 files do not contain BOM" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkBom" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s checkBom" - name: "Test .rst files for integrity" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkRst" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s checkRst" - name: "Find duplicate exception codes" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkExceptionCodes" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s checkExceptionCodes" - name: "Run PHPStan" - run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s phpstan" + run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s phpstan" # testsuite: # name: all tests with core v11 diff --git a/Build/Scripts/composer-for-core-version.sh b/Build/Scripts/composer-for-core-version.sh index 9b6c47b..35a4931 100755 --- a/Build/Scripts/composer-for-core-version.sh +++ b/Build/Scripts/composer-for-core-version.sh @@ -40,6 +40,16 @@ update_v11() { "phpunit/phpunit":"^9.6.8" } +update_v10() { + echo -e "💪 Enforce TYPO3 v10" + composer require --no-update \ + "typo3/cms-core":"^10.4" + + echo -e "💪 Enforce PHPUnit ^9.5.25" + composer req --dev --no-update \ + "phpunit/phpunit":"^9.5.25" +} + case "$1" in 12) composer_cleanup @@ -51,8 +61,13 @@ case "$1" in update_v11 composer_update ;; +10) + composer_cleanup + update_v10 + composer_update + ;; *) - echo -e "🌀 Usage: ddev update-to (11|12)" >&2 + echo -e "🌀 Usage: ddev update-to (10|11|12)" >&2 exit 0 ;; esac diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index d19f344..b2c8454 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -112,10 +112,11 @@ Options: - 8.1: use PHP 8.1 - 8.2: use PHP 8.2 - -t <11|12> + -t <10|11|12> Only with -s composerUpdate Specifies the TYPO3 core major version to be used - - 11 (default): use TYPO3 core v11 + - 10 (default): use TYPO3 core v10 + - 11: use TYPO3 core v11 - 12: use TYPO3 core v12 -e "" @@ -192,7 +193,7 @@ fi TEST_SUITE="" DBMS="sqlite" PHP_VERSION="7.4" -TYPO3_VERSION="11" +TYPO3_VERSION="10" PHP_XDEBUG_ON=0 EXTRA_TEST_OPTIONS="" SCRIPT_VERBOSE=0 @@ -225,7 +226,7 @@ while getopts ":s:a:d:p:t:e:xnhuv" OPT; do ;; t) TYPO3_VERSION=${OPTARG} - if ! [[ ${TYPO3_VERSION} =~ ^(11|12)$ ]]; then + if ! [[ ${TYPO3_VERSION} =~ ^(10|11|12)$ ]]; then INVALID_OPTIONS+=("p ${OPTARG}") fi ;; @@ -347,7 +348,7 @@ case ${TEST_SUITE} in case ${DBMS} in mariadb) echo "Using driver: ${DATABASE_DRIVER}" - if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then + if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then docker-compose run functional_mariadb10 SUITE_EXIT_CODE=$? else @@ -357,7 +358,7 @@ case ${TEST_SUITE} in ;; mysql) echo "Using driver: ${DATABASE_DRIVER}" - if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then + if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then docker-compose run functional_mysql80 SUITE_EXIT_CODE=$? else @@ -366,7 +367,7 @@ case ${TEST_SUITE} in fi ;; postgres) - if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then + if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then docker-compose run functional_postgres10 SUITE_EXIT_CODE=$? else @@ -380,9 +381,12 @@ case ${TEST_SUITE} in # root if docker creates it. Thank you, docker. We create the path beforehand # to avoid permission issues. mkdir -p ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/ - if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then + if [[ "${TYPO3_VERSION}" -eq 10 ]] ; then docker-compose run functional_sqlite SUITE_EXIT_CODE=$? + elif [[ "${TYPO3_VERSION}" -eq 11 ]] ; then + docker-compose run functional_sqlite_phpunit9 + SUITE_EXIT_CODE=$? else docker-compose run functional_sqlite_phpunit10 SUITE_EXIT_CODE=$? @@ -429,7 +433,7 @@ case ${TEST_SUITE} in ;; unit) setUpDockerComposeDotEnv - if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then + if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then docker-compose run unit SUITE_EXIT_CODE=$? else diff --git a/Build/phpstan/Core10/phpstan-baseline.neon b/Build/phpstan/Core10/phpstan-baseline.neon new file mode 100644 index 0000000..efa825b --- /dev/null +++ b/Build/phpstan/Core10/phpstan-baseline.neon @@ -0,0 +1,6 @@ +parameters: + ignoreErrors: + - + message: "#^Variable \\$_EXTKEY might not be defined\\.$#" + count: 1 + path: ../../../ext_emconf.php diff --git a/Build/phpstan/Core10/phpstan.neon b/Build/phpstan/Core10/phpstan.neon new file mode 100644 index 0000000..2d62156 --- /dev/null +++ b/Build/phpstan/Core10/phpstan.neon @@ -0,0 +1,17 @@ +includes: + - ../../../.Build/vendor/saschaegerer/phpstan-typo3/extension.neon + - phpstan-baseline.neon + +parameters: + # Use local .cache dir instead of /tmp + tmpDir: ../../../.cache/phpstan + + level: 8 + + paths: + - ../../../ + + excludePaths: + - ../../../.Build + - ../../../.cache + - ../../../Build diff --git a/Build/phpstan/Core11/phpstan.neon b/Build/phpstan/Core11/phpstan.neon index 2d62156..25a4a9e 100644 --- a/Build/phpstan/Core11/phpstan.neon +++ b/Build/phpstan/Core11/phpstan.neon @@ -9,7 +9,8 @@ parameters: level: 8 paths: - - ../../../ + - ../../../Classes + - ../../../Tests/ excludePaths: - ../../../.Build diff --git a/Build/phpstan/Core12/phpstan.neon b/Build/phpstan/Core12/phpstan.neon index d636a12..58e04be 100644 --- a/Build/phpstan/Core12/phpstan.neon +++ b/Build/phpstan/Core12/phpstan.neon @@ -14,5 +14,3 @@ parameters: excludePaths: - ../../../.Build - - ../../../Tests/Functional/Updates/Fixtures/Extension/test_extension/ext_emconf.php - - ../../../Classes/Override/Core11 diff --git a/Build/phpunit/FunctionalTests-10.xml b/Build/phpunit/FunctionalTests-10.xml index 5865776..350890d 100644 --- a/Build/phpunit/FunctionalTests-10.xml +++ b/Build/phpunit/FunctionalTests-10.xml @@ -48,7 +48,7 @@ diff --git a/composer.json b/composer.json index f9f7575..da2d20d 100644 --- a/composer.json +++ b/composer.json @@ -20,43 +20,44 @@ { "type": "git", "url": "https://github.com/andreaswolf/typo3-ext-migrations.git" } ], "require": { - "php": "^8.1", - "typo3/cms-core": "^11.5", - "typo3/cms-rte-ckeditor": "^11.5" + "php": "^7.4", + "typo3/cms-core": "^10.4", + "typo3/cms-rte-ckeditor": "^10.4" }, "require-dev": { - "typo3/cms-adminpanel": "^11.5", - "typo3/cms-backend": "^11.5", - "typo3/cms-belog": "^11.5", - "typo3/cms-beuser": "^11.5", - "typo3/cms-dashboard": "^11.5", - "typo3/cms-extbase": "^11.5", - "typo3/cms-extensionmanager": "^11.5", - "typo3/cms-felogin": "^11.5", - "typo3/cms-filelist": "^11.5", - "typo3/cms-filemetadata": "^11.5", - "typo3/cms-fluid": "^11.5", - "typo3/cms-fluid-styled-content": "^11.5", - "typo3/cms-form": "^11.5", - "typo3/cms-frontend": "^11.5", - "typo3/cms-impexp": "^11.5", - "typo3/cms-indexed-search": "^11.5", - "typo3/cms-info": "^11.5", - "typo3/cms-install": "^11.5", - "typo3/cms-linkvalidator": "^11.5", - "typo3/cms-lowlevel": "^11.5", - "typo3/cms-seo": "^11.5", - "typo3/cms-setup": "^11.5", - "typo3/cms-tstemplate": "^11.5", - "typo3/minimal": "^11", - "typo3/cms-composer-installers": "v4.0.0-RC1", - "helhum/typo3-console": "^7.1 || ^8.0", - "saschaegerer/phpstan-typo3": "^1.8", - "friendsofphp/php-cs-fixer": "^3.14", - "bk2k/bootstrap-package": "^14.0", + "typo3/cms-adminpanel": "^10.4", + "typo3/cms-backend": "^10.4", + "typo3/cms-belog": "^10.4", + "typo3/cms-beuser": "^10.4", + "typo3/cms-dashboard": "^10.4", + "typo3/cms-extbase": "^10.4", + "typo3/cms-extensionmanager": "^10.4", + "typo3/cms-felogin": "^10.4", + "typo3/cms-filelist": "^10.4", + "typo3/cms-filemetadata": "^10.4", + "typo3/cms-fluid": "^10.4", + "typo3/cms-fluid-styled-content": "^10.4", + "typo3/cms-form": "^10.4", + "typo3/cms-frontend": "^10.4", + "typo3/cms-impexp": "^10.4", + "typo3/cms-indexed-search": "^10.4", + "typo3/cms-info": "^10.4", + "typo3/cms-install": "^10.4", + "typo3/cms-linkvalidator": "^10.4", + "typo3/cms-lowlevel": "^10.4", + "typo3/cms-seo": "^10.4", + "typo3/cms-setup": "^10.4", + "typo3/cms-tstemplate": "^10.4", + "typo3/minimal": "^10", + "typo3/cms-composer-installers": "^3.1 || ^5.0", + "helhum/typo3-console": "^6.7 || ^7.1 || ^8.0", + "saschaegerer/phpstan-typo3": "^1.10", + "friendsofphp/php-cs-fixer": "^3.59", + "bk2k/bootstrap-package": "^12.0 || ^14.0", "kaystrobach/migrations": "0.11.0", "andreaswolf/typo3-uuid": "^0.3.0", - "cweagans/composer-patches": "^1.7" + "cweagans/composer-patches": "^1.7", + "phpunit/phpunit": "^9.5.25 || ^9.6.8 || ^10.1" }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index ffe8e86..c32716c 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -5,7 +5,7 @@ 'description' => 'The Academic Jobs extension allows users to create and manage job postings.', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-12.4.99', + 'typo3' => '10.4.0-12.4.99', ], ], 'state' => 'beta',