From 5e0816402064e30f3c33915de3f829927af0dd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Itay=20Kr=C3=A4mer?= Date: Thu, 22 Oct 2026 12:39:55 +0000 Subject: [PATCH 1/6] [TASK] Add PHP 8.5 support and apply review feedback --- .github/workflows/tasks.yml | 9 +++++---- composer.json | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tasks.yml b/.github/workflows/tasks.yml index 4827bdf..b0ddf92 100644 --- a/.github/workflows/tasks.yml +++ b/.github/workflows/tasks.yml @@ -9,8 +9,8 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '8.3', '8.4' ] - typo3: [ '12', '13' ] + php: ['8.2', '8.3', '8.4', '8.5'] + typo3: ['13'] steps: - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 @@ -23,6 +23,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-${{ matrix.php }}-composer- - - run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev --ignore-platform-req=php+ - - run: composer install --no-interaction --no-progress --ignore-platform-req=php+ + # Remove the alias when TYPO3 accepts ^1.0. + - run: TYPO3_SKIP_ASSET_PUBLISH=true composer require typo3/minimal="^${{ matrix.typo3 }}" "enshrined/svg-sanitize:~1.0.0" --dev --no-scripts --sort-packages -W + - run: composer install --no-interaction --no-progress - run: ./vendor/bin/grumphp run --ansi diff --git a/composer.json b/composer.json index a1ba01f..86e6f04 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ ], "type": "typo3-cms-extension", "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", - "typo3/cms-core": "^12.4 || ^13.4", - "typo3/cms-frontend": "^12.4 || ^13.4" + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "typo3/cms-core": "^13.4", + "typo3/cms-frontend": "^13.4" }, "require-dev": { "pluswerk/grumphp-config": "^7.2.0 || ^10.1.4", From 46f5145e8fb01d71c580c0a722aac00be7ddf05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Itay=20Kr=C3=A4mer?= Date: Fri, 23 Oct 2026 16:28:08 +0200 Subject: [PATCH 2/6] [TASK] Add PHP 8.5 compatibility and CI coverage Preserve supported PHP and TYPO3 versions, check dependency bounds, and add regression tests for compatibility fixes. --- .github/workflows/tasks.yml | 61 +++++++++++++++++++ Build/Configuration/PHP/testing.ini | 3 + Build/Scripts/check-compatibility.sh | 63 +++++++++++++++++++ Tests/Unit/RelationProcessorTest.php | 91 ++++++++++++++++++++++++++++ composer.json | 14 ++++- grumphp.yml | 3 + rector.php | 1 + 7 files changed, 234 insertions(+), 2 deletions(-) create mode 100644 Build/Configuration/PHP/testing.ini create mode 100644 Build/Scripts/check-compatibility.sh create mode 100644 Tests/Unit/RelationProcessorTest.php diff --git a/.github/workflows/tasks.yml b/.github/workflows/tasks.yml index 4827bdf..38cfb84 100644 --- a/.github/workflows/tasks.yml +++ b/.github/workflows/tasks.yml @@ -26,3 +26,64 @@ jobs: - run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev --ignore-platform-req=php+ - run: composer install --no-interaction --no-progress --ignore-platform-req=php+ - run: ./vendor/bin/grumphp run --ansi + compatibility: + name: 'Compatibility PHP ${{ matrix.php }} / TYPO3 ${{ matrix.typo3 }} / ${{ matrix.dependencies }}' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - + php: '8.2' + typo3: '12' + dependencies: latest + - + php: '8.3' + typo3: '12' + dependencies: latest + - + php: '8.4' + typo3: '12' + dependencies: latest + - + php: '8.2' + typo3: '12' + dependencies: lowest + - + php: '8.2' + typo3: '13' + dependencies: latest + - + php: '8.3' + typo3: '13' + dependencies: latest + - + php: '8.4' + typo3: '13' + dependencies: latest + - + php: '8.5' + typo3: '13' + dependencies: latest + - + php: '8.2' + typo3: '13' + dependencies: lowest + - + php: '8.5' + typo3: '13' + dependencies: lowest + steps: + - + uses: actions/checkout@v4 + - + uses: shivammathur/setup-php@v2 + with: + php-version: '${{ matrix.php }}' + extensions: 'apcu, bcmath, gd, intl, mbstring, pdo_sqlite, sqlite3, zip' + coverage: pcov + tools: 'composer:v2' + ini-values: 'apc.enable_cli=1, memory_limit=1G' + - + name: 'Resolve and check compatibility' + run: 'sh Build/Scripts/check-compatibility.sh ${{ matrix.php }} ${{ matrix.typo3 }} ${{ matrix.dependencies }}' diff --git a/Build/Configuration/PHP/testing.ini b/Build/Configuration/PHP/testing.ini new file mode 100644 index 0000000..daef18b --- /dev/null +++ b/Build/Configuration/PHP/testing.ini @@ -0,0 +1,3 @@ +apc.enable_cli=1 +memory_limit=1G +error_reporting=E_ALL diff --git a/Build/Scripts/check-compatibility.sh b/Build/Scripts/check-compatibility.sh new file mode 100644 index 0000000..4f816c1 --- /dev/null +++ b/Build/Scripts/check-compatibility.sh @@ -0,0 +1,63 @@ +#!/bin/sh +set -eu + +php_version="${1:?PHP version required}" +typo3_version="${2:?TYPO3 major required}" +dependencies="${3:-latest}" + +php -r 'exit(PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION === $argv[1] ? 0 : 1);' "$php_version" +php -v +composer self-update --2 --no-interaction +composer --version +case "$php_version:$typo3_version" in + 8.1:11|8.2:11|8.3:11|8.1:12|8.2:12|8.3:12|8.4:12|8.2:13|8.3:13|8.4:13|8.5:13) ;; + *) printf 'Unsupported PHP/TYPO3 pair: %s / %s\n' "$php_version" "$typo3_version"; exit 1 ;; +esac +case "$dependencies" in latest|lowest) ;; *) exit 1 ;; esac + +export GRUMPHP_GIT_HOOKS_ENABLED=0 +export typo3DatabaseDriver=pdo_sqlite +export XDEBUG_MODE=off +export PHP_INI_SCAN_DIR="${PHP_INI_SCAN_DIR:-}:$(pwd)/Build/Configuration/PHP" + +composer validate --no-check-publish --no-interaction +composer config lock true +composer require --dev --sort-packages 'squizlabs/php_codesniffer:^3.8.0 || ^4.0' --no-update --no-interaction +case "$typo3_version" in + 11) constraint='^11.5' ;; + 12) constraint='^12.4' ;; + 13) + constraint='^13.4' + composer require --dev --sort-packages 'saschaegerer/phpstan-typo3:^2.2.0' 'ssch/typo3-rector:^3.16.0' 'rector/rector:^2.7.0' 'pluswerk/grumphp-config:^11.2.0' --no-update --no-interaction + ;; +esac +composer require --dev --sort-packages "typo3/minimal:$constraint" --no-update --no-interaction +if [ "$php_version" = 8.5 ]; then + composer require --dev --sort-packages 'phpunit/phpunit:^10.5.62 || ^11.5.50 || ^12.5.0 || ^13.0.2' --no-update --no-interaction +fi +if [ "$dependencies" = lowest ]; then + composer update --with-all-dependencies --prefer-lowest --prefer-stable --no-interaction --no-progress --no-scripts +else + composer update --with-all-dependencies --prefer-stable --no-interaction --no-progress --no-scripts +fi +composer check-platform-reqs +if [ "$php_version" = 8.5 ]; then + composer prohibits php 8.5.0 || true +fi + +git ls-files -z '*.php' | xargs -0 -n 1 php -l +php vendor/bin/rector process --dry-run --no-progress-bar +configuration_directory="$(mktemp -d)" +configuration="$configuration_directory/phpstan.neon" +trap 'rm -f "$configuration" "$configuration_directory/grumphp.yml"; rmdir "$configuration_directory"' EXIT HUP INT TERM +php -r 'echo "includes:\n - ", json_encode(getcwd() . "/phpstan.neon"), "\nparameters:\n phpVersion: ", PHP_VERSION_ID, "\n";' > "$configuration" +php vendor/bin/phpstan analyse Classes --configuration="$configuration" --no-progress --memory-limit=1G +composer audit --no-interaction --abandoned=report +php -r 'require "vendor/autoload.php"; $configuration = ["imports" => [["resource" => getcwd() . "/grumphp.yml"]]]; $defaults = Symfony\Component\Yaml\Yaml::parseFile("vendor/pluswerk/grumphp-config/grumphp.yml"); if (isset($defaults["grumphp"]["tasks"]["securitychecker_enlightn"])) { $configuration["grumphp"]["tasks"]["securitychecker_enlightn"]["metadata"]["enabled"] = false; } file_put_contents($argv[1], Symfony\Component\Yaml\Yaml::dump($configuration, 6, 2));' "$configuration_directory/grumphp.yml" +php vendor/bin/grumphp run --config="$configuration_directory/grumphp.yml" --no-interaction +if php -r '$c=json_decode(file_get_contents("composer.json"),true); exit(isset($c["scripts"]["test"]) ? 0 : 1);'; then + composer test +else + printf 'No configured test script; unit, functional and browser coverage remains unverified.\n' + exit 1 +fi diff --git a/Tests/Unit/RelationProcessorTest.php b/Tests/Unit/RelationProcessorTest.php new file mode 100644 index 0000000..5e9ba6e --- /dev/null +++ b/Tests/Unit/RelationProcessorTest.php @@ -0,0 +1,91 @@ +|null */ + private ?array $previousTca = null; + + protected function setUp(): void + { + $this->previousTca = $GLOBALS['TCA'] ?? null; + $GLOBALS['TCA'] = []; + } + + protected function tearDown(): void + { + if ($this->previousTca === null) { + unset($GLOBALS['TCA']); + } else { + $GLOBALS['TCA'] = $this->previousTca; + } + } + + public function testRejectsMissingTcaConfiguration(): void + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('TCA config for tt_content.items not found'); + + $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); + } + + public function testRejectsMissingForeignTable(): void + { + $this->configureRelation([]); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('TCA config foreign_table not found'); + + $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); + } + + public function testRejectsMmHasUidField(): void + { + $this->configureRelation(['foreign_table' => 'pages', 'MM' => 'test_mm', 'MM_hasUidField' => true]); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('TCA config MM_hasUidField not supported'); + + $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); + } + + public function testRejectsMmIsForeign(): void + { + $this->configureRelation(['foreign_table' => 'pages', 'MM' => 'test_mm', 'MM_is_foreign' => true]); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('TCA config MM_is_foreign not supported'); + + $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); + } + + public function testRejectsMmOppositeUsage(): void + { + $this->configureRelation(['foreign_table' => 'pages', 'MM' => 'test_mm', 'MM_oppositeUsage' => []]); + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('TCA config MM_oppositeUsage not supported'); + + $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); + } + + private function processor(): RelationProcessor + { + $connectionPool = $this->createMock(ConnectionPool::class); + $connectionPool->expects(self::never())->method('getQueryBuilderForTable'); + + return new RelationProcessor($connectionPool, $this->createMock(ContentDataProcessor::class)); + } + + /** @param array $configuration */ + private function configureRelation(array $configuration): void + { + $GLOBALS['TCA']['tt_content']['columns']['items']['config'] = $configuration; + } +} diff --git a/composer.json b/composer.json index a1ba01f..499ac81 100644 --- a/composer.json +++ b/composer.json @@ -6,12 +6,13 @@ ], "type": "typo3-cms-extension", "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "typo3/cms-core": "^12.4 || ^13.4", "typo3/cms-frontend": "^12.4 || ^13.4" }, "require-dev": { - "pluswerk/grumphp-config": "^7.2.0 || ^10.1.4", + "phpunit/phpunit": "^9.6.31 || ^10.5.62", + "pluswerk/grumphp-config": "^7.2.0 || ^10.1.4 || ^11.2.0", "saschaegerer/phpstan-typo3": "^1.10.2 || ^2.1.1", "ssch/typo3-rector": "*" }, @@ -20,8 +21,14 @@ "AUS\\RelationProcessor\\": "Classes/" } }, + "autoload-dev": { + "psr-4": { + "AUS\\RelationProcessor\\Tests\\": "Tests/" + } + }, "config": { "allow-plugins": { + "a9f/fractor-extension-installer": true, "ergebnis/composer-normalize": true, "phpro/grumphp": true, "phpstan/extension-installer": true, @@ -35,5 +42,8 @@ "typo3/cms": { "extension-key": "relation_processor" } + }, + "scripts": { + "test": "@php vendor/bin/phpunit --bootstrap vendor/autoload.php Tests/Unit/" } } diff --git a/grumphp.yml b/grumphp.yml index f682bd0..e36b098 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -1,5 +1,8 @@ imports: - { resource: vendor/pluswerk/grumphp-config/grumphp.yml } +grumphp: + parallel: + enabled: false parameters: convention.process_timeout: 240 convention.security_checker_blocking: false diff --git a/rector.php b/rector.php index fe73218..75f35fa 100644 --- a/rector.php +++ b/rector.php @@ -7,6 +7,7 @@ use Rector\Caching\ValueObject\Storage\FileCacheStorage; return static function (RectorConfig $rectorConfig): void { + $rectorConfig->phpVersion(80200); $rectorConfig->parallel(); $rectorConfig->importNames(); $rectorConfig->importShortClasses(); From 0bbe32a44e0630038989c7f9ca721d3fa13a965e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Itay=20Kr=C3=A4mer?= Date: Mon, 26 Oct 2026 12:44:58 +0100 Subject: [PATCH 3/6] [!!!] [BUGFIX] Fix PHP 8.5 CI and drop ELTS TYPO3 support --- .github/workflows/tasks.yml | 85 ++++++---------------------- Build/Scripts/check-compatibility.sh | 15 +---- composer.json | 4 +- grumphp.yml | 2 +- 4 files changed, 23 insertions(+), 83 deletions(-) diff --git a/.github/workflows/tasks.yml b/.github/workflows/tasks.yml index 9fa6ba7..1ee0b00 100644 --- a/.github/workflows/tasks.yml +++ b/.github/workflows/tasks.yml @@ -1,90 +1,41 @@ name: Tasks - -on: [push, pull_request] - +'on': + - push + - pull_request jobs: - lint-php: - name: "php: ${{ matrix.php }} TYPO3: ${{ matrix.typo3 }}" - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: ['8.2', '8.3', '8.4', '8.5'] - typo3: ['13'] - steps: - - name: Setup PHP with PECL extension - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - - uses: actions/checkout@v2 - - uses: actions/cache@v3 - with: - path: ~/.composer/cache/files - key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.php }}-composer- - # Remove the alias when TYPO3 accepts ^1.0. - - run: TYPO3_SKIP_ASSET_PUBLISH=true composer require typo3/minimal="^${{ matrix.typo3 }}" "enshrined/svg-sanitize:~1.0.0" --dev --no-scripts --sort-packages -W - - run: composer install --no-interaction --no-progress - - run: ./vendor/bin/grumphp run --ansi compatibility: - name: 'Compatibility PHP ${{ matrix.php }} / TYPO3 ${{ matrix.typo3 }} / ${{ matrix.dependencies }}' + name: Compatibility PHP ${{ matrix.php }} / TYPO3 ${{ matrix.typo3 }} / ${{ matrix.dependencies }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - - - php: '8.2' - typo3: '12' - dependencies: latest - - - php: '8.3' - typo3: '12' - dependencies: latest - - - php: '8.4' - typo3: '12' - dependencies: latest - - - php: '8.2' - typo3: '12' - dependencies: lowest - - - php: '8.2' + - php: '8.2' typo3: '13' dependencies: latest - - - php: '8.3' + - php: '8.3' typo3: '13' dependencies: latest - - - php: '8.4' + - php: '8.4' typo3: '13' dependencies: latest - - - php: '8.5' + - php: '8.5' typo3: '13' dependencies: latest - - - php: '8.2' + - php: '8.2' typo3: '13' dependencies: lowest - - - php: '8.5' + - php: '8.5' typo3: '13' dependencies: lowest steps: - - - uses: actions/checkout@v4 - - - uses: shivammathur/setup-php@v2 + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 with: - php-version: '${{ matrix.php }}' - extensions: 'apcu, bcmath, gd, intl, mbstring, pdo_sqlite, sqlite3, zip' + php-version: ${{ matrix.php }} + extensions: apcu, bcmath, gd, intl, mbstring, pdo_sqlite, sqlite3, zip coverage: pcov - tools: 'composer:v2' - ini-values: 'apc.enable_cli=1, memory_limit=1G' - - - name: 'Resolve and check compatibility' - run: 'sh Build/Scripts/check-compatibility.sh ${{ matrix.php }} ${{ matrix.typo3 }} ${{ matrix.dependencies }}' + tools: composer:v2 + ini-values: apc.enable_cli=1, memory_limit=1G + - name: Resolve and check compatibility + run: sh Build/Scripts/check-compatibility.sh ${{ matrix.php }} ${{ matrix.typo3 }} ${{ matrix.dependencies }} diff --git a/Build/Scripts/check-compatibility.sh b/Build/Scripts/check-compatibility.sh index 4f816c1..4129bf8 100644 --- a/Build/Scripts/check-compatibility.sh +++ b/Build/Scripts/check-compatibility.sh @@ -10,7 +10,7 @@ php -v composer self-update --2 --no-interaction composer --version case "$php_version:$typo3_version" in - 8.1:11|8.2:11|8.3:11|8.1:12|8.2:12|8.3:12|8.4:12|8.2:13|8.3:13|8.4:13|8.5:13) ;; + 8.2:13|8.3:13|8.4:13|8.5:13) ;; *) printf 'Unsupported PHP/TYPO3 pair: %s / %s\n' "$php_version" "$typo3_version"; exit 1 ;; esac case "$dependencies" in latest|lowest) ;; *) exit 1 ;; esac @@ -24,8 +24,6 @@ composer validate --no-check-publish --no-interaction composer config lock true composer require --dev --sort-packages 'squizlabs/php_codesniffer:^3.8.0 || ^4.0' --no-update --no-interaction case "$typo3_version" in - 11) constraint='^11.5' ;; - 12) constraint='^12.4' ;; 13) constraint='^13.4' composer require --dev --sort-packages 'saschaegerer/phpstan-typo3:^2.2.0' 'ssch/typo3-rector:^3.16.0' 'rector/rector:^2.7.0' 'pluswerk/grumphp-config:^11.2.0' --no-update --no-interaction @@ -45,16 +43,7 @@ if [ "$php_version" = 8.5 ]; then composer prohibits php 8.5.0 || true fi -git ls-files -z '*.php' | xargs -0 -n 1 php -l -php vendor/bin/rector process --dry-run --no-progress-bar -configuration_directory="$(mktemp -d)" -configuration="$configuration_directory/phpstan.neon" -trap 'rm -f "$configuration" "$configuration_directory/grumphp.yml"; rmdir "$configuration_directory"' EXIT HUP INT TERM -php -r 'echo "includes:\n - ", json_encode(getcwd() . "/phpstan.neon"), "\nparameters:\n phpVersion: ", PHP_VERSION_ID, "\n";' > "$configuration" -php vendor/bin/phpstan analyse Classes --configuration="$configuration" --no-progress --memory-limit=1G -composer audit --no-interaction --abandoned=report -php -r 'require "vendor/autoload.php"; $configuration = ["imports" => [["resource" => getcwd() . "/grumphp.yml"]]]; $defaults = Symfony\Component\Yaml\Yaml::parseFile("vendor/pluswerk/grumphp-config/grumphp.yml"); if (isset($defaults["grumphp"]["tasks"]["securitychecker_enlightn"])) { $configuration["grumphp"]["tasks"]["securitychecker_enlightn"]["metadata"]["enabled"] = false; } file_put_contents($argv[1], Symfony\Component\Yaml\Yaml::dump($configuration, 6, 2));' "$configuration_directory/grumphp.yml" -php vendor/bin/grumphp run --config="$configuration_directory/grumphp.yml" --no-interaction +php vendor/bin/grumphp run --no-interaction if php -r '$c=json_decode(file_get_contents("composer.json"),true); exit(isset($c["scripts"]["test"]) ? 0 : 1);'; then composer test else diff --git a/composer.json b/composer.json index 499ac81..2df9e07 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ "type": "typo3-cms-extension", "require": { "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "typo3/cms-core": "^12.4 || ^13.4", - "typo3/cms-frontend": "^12.4 || ^13.4" + "typo3/cms-core": "^13.4", + "typo3/cms-frontend": "^13.4" }, "require-dev": { "phpunit/phpunit": "^9.6.31 || ^10.5.62", diff --git a/grumphp.yml b/grumphp.yml index e36b098..7737552 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -5,7 +5,7 @@ grumphp: enabled: false parameters: convention.process_timeout: 240 - convention.security_checker_blocking: false + convention.security_checker_blocking: true convention.jsonlint_ignore_pattern: { } convention.xmllint_ignore_pattern: { } convention.yamllint_ignore_pattern: { } From 382f09a5f842e4c1c7000557137b705909df3685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Itay=20Kr=C3=A4mer?= Date: Mon, 26 Oct 2026 14:35:45 +0100 Subject: [PATCH 4/6] [BUGFIX] Fix Rector 2.8 CI checks --- rector.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/rector.php b/rector.php index 75f35fa..d9aac2b 100644 --- a/rector.php +++ b/rector.php @@ -4,14 +4,12 @@ use PLUS\GrumPHPConfig\RectorSettings; use Rector\Config\RectorConfig; -use Rector\Caching\ValueObject\Storage\FileCacheStorage; return static function (RectorConfig $rectorConfig): void { $rectorConfig->phpVersion(80200); $rectorConfig->parallel(); $rectorConfig->importNames(); $rectorConfig->importShortClasses(); - $rectorConfig->cacheClass(FileCacheStorage::class); $rectorConfig->cacheDirectory('./var/cache/rector'); $rectorConfig->paths( From 3bc4830ce9f4f874c91424a6cefd8a7995293512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Itay=20Kr=C3=A4mer?= Date: Mon, 26 Oct 2026 15:26:53 +0100 Subject: [PATCH 5/6] [TASK] Minimize PHP 8.5 compatibility changes --- Build/Scripts/check-compatibility.sh | 6 -- Tests/Unit/RelationProcessorTest.php | 91 ---------------------------- composer.json | 9 --- 3 files changed, 106 deletions(-) delete mode 100644 Tests/Unit/RelationProcessorTest.php diff --git a/Build/Scripts/check-compatibility.sh b/Build/Scripts/check-compatibility.sh index 4129bf8..9db8be7 100644 --- a/Build/Scripts/check-compatibility.sh +++ b/Build/Scripts/check-compatibility.sh @@ -44,9 +44,3 @@ if [ "$php_version" = 8.5 ]; then fi php vendor/bin/grumphp run --no-interaction -if php -r '$c=json_decode(file_get_contents("composer.json"),true); exit(isset($c["scripts"]["test"]) ? 0 : 1);'; then - composer test -else - printf 'No configured test script; unit, functional and browser coverage remains unverified.\n' - exit 1 -fi diff --git a/Tests/Unit/RelationProcessorTest.php b/Tests/Unit/RelationProcessorTest.php deleted file mode 100644 index 5e9ba6e..0000000 --- a/Tests/Unit/RelationProcessorTest.php +++ /dev/null @@ -1,91 +0,0 @@ -|null */ - private ?array $previousTca = null; - - protected function setUp(): void - { - $this->previousTca = $GLOBALS['TCA'] ?? null; - $GLOBALS['TCA'] = []; - } - - protected function tearDown(): void - { - if ($this->previousTca === null) { - unset($GLOBALS['TCA']); - } else { - $GLOBALS['TCA'] = $this->previousTca; - } - } - - public function testRejectsMissingTcaConfiguration(): void - { - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('TCA config for tt_content.items not found'); - - $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); - } - - public function testRejectsMissingForeignTable(): void - { - $this->configureRelation([]); - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('TCA config foreign_table not found'); - - $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); - } - - public function testRejectsMmHasUidField(): void - { - $this->configureRelation(['foreign_table' => 'pages', 'MM' => 'test_mm', 'MM_hasUidField' => true]); - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('TCA config MM_hasUidField not supported'); - - $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); - } - - public function testRejectsMmIsForeign(): void - { - $this->configureRelation(['foreign_table' => 'pages', 'MM' => 'test_mm', 'MM_is_foreign' => true]); - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('TCA config MM_is_foreign not supported'); - - $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); - } - - public function testRejectsMmOppositeUsage(): void - { - $this->configureRelation(['foreign_table' => 'pages', 'MM' => 'test_mm', 'MM_oppositeUsage' => []]); - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('TCA config MM_oppositeUsage not supported'); - - $this->processor()->getRelation($this->createMock(ContentObjectRenderer::class), 'tt_content', 'items', 1); - } - - private function processor(): RelationProcessor - { - $connectionPool = $this->createMock(ConnectionPool::class); - $connectionPool->expects(self::never())->method('getQueryBuilderForTable'); - - return new RelationProcessor($connectionPool, $this->createMock(ContentDataProcessor::class)); - } - - /** @param array $configuration */ - private function configureRelation(array $configuration): void - { - $GLOBALS['TCA']['tt_content']['columns']['items']['config'] = $configuration; - } -} diff --git a/composer.json b/composer.json index 2df9e07..93b9575 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "typo3/cms-frontend": "^13.4" }, "require-dev": { - "phpunit/phpunit": "^9.6.31 || ^10.5.62", "pluswerk/grumphp-config": "^7.2.0 || ^10.1.4 || ^11.2.0", "saschaegerer/phpstan-typo3": "^1.10.2 || ^2.1.1", "ssch/typo3-rector": "*" @@ -21,11 +20,6 @@ "AUS\\RelationProcessor\\": "Classes/" } }, - "autoload-dev": { - "psr-4": { - "AUS\\RelationProcessor\\Tests\\": "Tests/" - } - }, "config": { "allow-plugins": { "a9f/fractor-extension-installer": true, @@ -42,8 +36,5 @@ "typo3/cms": { "extension-key": "relation_processor" } - }, - "scripts": { - "test": "@php vendor/bin/phpunit --bootstrap vendor/autoload.php Tests/Unit/" } } From 5339c1672c6728950c0fbeebddcfcc8b0ae8174f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Itay=20Kr=C3=A4mer?= Date: Mon, 26 Oct 2026 16:25:57 +0100 Subject: [PATCH 6/6] [TASK] Remove unrelated PHP 8.5 migration changes --- grumphp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grumphp.yml b/grumphp.yml index 7737552..c33a573 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -4,8 +4,9 @@ grumphp: parallel: enabled: false parameters: + convention.fractor_enable: false convention.process_timeout: 240 - convention.security_checker_blocking: true + convention.security_checker_blocking: false convention.jsonlint_ignore_pattern: { } convention.xmllint_ignore_pattern: { } convention.yamllint_ignore_pattern: { }