From 4ff01f31aa64603caa990d3d1ff46e8398b14397 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Wed, 22 Apr 2026 12:16:56 +0200 Subject: [PATCH 1/6] task: add Symfony PHPUnit Bridge for better deprecation handling --- .github/workflows/tests.yaml | 3 +-- composer.json | 3 ++- phpunit.xml.dist | 3 +++ phpunit9.xml.dist | 6 ++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ec5bcbd..c194e44 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -108,5 +108,4 @@ jobs: CONFIG="--configuration phpunit9.xml.dist" fi - # Ignore deprecations with "8191" = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED - php -d error_reporting=8191 vendor/bin/phpunit --fail-on-risky ${CONFIG:-} + composer tests -- ${CONFIG:-} diff --git a/composer.json b/composer.json index 759cf5c..679faf7 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,8 @@ "phpstan/phpstan-phpunit": "^1.3.16", "phpstan/phpstan-symfony": "^1.3.8", "shipmonk/composer-dependency-analyser": "^1.7", - "symfony/http-foundation": "^6.4 || ^7.3" + "symfony/http-foundation": "^6.4 || ^7.3", + "symfony/phpunit-bridge": "^8.0" }, "conflict": { "pimcore/pimcore": ">=11.2.0 <11.2.2" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3759a6c..77355e1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,12 +7,14 @@ bootstrap="tests/bootstrap.php" cacheDirectory=".phpunit.cache" colors="true" + failOnRisky="true" failOnWarning="true" > + @@ -31,5 +33,6 @@ + diff --git a/phpunit9.xml.dist b/phpunit9.xml.dist index 58a4578..4c273df 100644 --- a/phpunit9.xml.dist +++ b/phpunit9.xml.dist @@ -7,12 +7,14 @@ bootstrap="tests/bootstrap.php" cacheResultFile=".phpunit.cache/test-results" colors="true" + failOnRisky="true" failOnWarning="true" > + @@ -30,4 +32,8 @@ + + + + From 4a8ea94c4d49260c6ab727219e054f4412e967ac Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Wed, 22 Apr 2026 12:57:37 +0200 Subject: [PATCH 2/6] task: add Symfony PHPUnit Bridge for better deprecation handling --- composer.json | 2 +- phpunit.xml.dist | 2 +- phpunit9.xml.dist | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 679faf7..239d584 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,7 @@ "dependencies:check": "composer-dependency-analyser", "phpstan": "phpstan analyse --ansi", "phpstan:gitlab-ci": "phpstan analyse --ansi --no-interaction --no-progress --error-format=gitlab > .reports/phpstan.json", - "tests": "phpunit", + "tests": "simple-phpunit", "tests:coverage:gitlab-ci": "phpunit --colors=never --coverage-text --coverage-clover .reports/clover.xml --coverage-cobertura .reports/cobertura.xml --log-junit .reports/junit.xml" }, "scripts-descriptions": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 77355e1..2e6e188 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ - + diff --git a/phpunit9.xml.dist b/phpunit9.xml.dist index 4c273df..10cae70 100644 --- a/phpunit9.xml.dist +++ b/phpunit9.xml.dist @@ -14,7 +14,7 @@ - + From 87f8a480f2b4f5b2e54a0b1f95db9b610c9883dd Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Wed, 22 Apr 2026 13:06:36 +0200 Subject: [PATCH 3/6] task: add Symfony PHPUnit Bridge for better deprecation handling --- phpunit.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2e6e188..4ae26a1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,9 @@ cacheDirectory=".phpunit.cache" colors="true" failOnRisky="true" + failOnNotice="true" failOnWarning="true" + failOnDeprecation="true" > From f083334bce294d54d5040ba246db74d113d1f342 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Wed, 22 Apr 2026 14:26:23 +0200 Subject: [PATCH 4/6] task: add Symfony PHPUnit Bridge for better deprecation handling --- composer.json | 2 +- phpunit.xml.dist | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 239d584..679faf7 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,7 @@ "dependencies:check": "composer-dependency-analyser", "phpstan": "phpstan analyse --ansi", "phpstan:gitlab-ci": "phpstan analyse --ansi --no-interaction --no-progress --error-format=gitlab > .reports/phpstan.json", - "tests": "simple-phpunit", + "tests": "phpunit", "tests:coverage:gitlab-ci": "phpunit --colors=never --coverage-text --coverage-clover .reports/clover.xml --coverage-cobertura .reports/cobertura.xml --log-junit .reports/junit.xml" }, "scripts-descriptions": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4ae26a1..3b82824 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,19 +4,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" beStrictAboutOutputDuringTests="true" + beStrictAboutChangesToGlobalState="true" bootstrap="tests/bootstrap.php" cacheDirectory=".phpunit.cache" colors="true" failOnRisky="true" failOnNotice="true" failOnWarning="true" - failOnDeprecation="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" > - @@ -35,6 +37,5 @@ - From c46849bde37a4fbff2b5908b43b665fcddb03e00 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Wed, 22 Apr 2026 14:36:29 +0200 Subject: [PATCH 5/6] task: add Symfony PHPUnit Bridge for better deprecation handling --- .github/workflows/tests.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c194e44..5f2c915 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -104,6 +104,10 @@ jobs: PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_INSTANCE_IDENTIFIER }} PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_PRODUCT_KEY }} run: | + if [ "${{ matrix.dependencies }}" = "lowest" ]; then + export SYMFONY_DEPRECATIONS_HELPER=disabled + fi + if [ "${{ matrix.phpunit-version }}" = "^9.6" ]; then CONFIG="--configuration phpunit9.xml.dist" fi From 32567fb2e659c12d4adbd10f81cb37f036475db1 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Wed, 22 Apr 2026 16:17:31 +0200 Subject: [PATCH 6/6] task: add Symfony PHPUnit Bridge for better deprecation handling --- phpunit9.xml.dist | 2 +- tests/deprecation-baseline.txt | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/deprecation-baseline.txt diff --git a/phpunit9.xml.dist b/phpunit9.xml.dist index 10cae70..c1f8591 100644 --- a/phpunit9.xml.dist +++ b/phpunit9.xml.dist @@ -14,7 +14,7 @@ - + diff --git a/tests/deprecation-baseline.txt b/tests/deprecation-baseline.txt new file mode 100644 index 0000000..08d8693 --- /dev/null +++ b/tests/deprecation-baseline.txt @@ -0,0 +1,16 @@ +# This file contains patterns to be ignored while testing for use of deprecated code. + +# Remaining "self" deprecation notices with Pimcore 11: +%Since symfony/framework-bundle 6\.4: The "annotations\.\w+" service is deprecated without replacement% + +# Remaining "direct" deprecation notices with Pimcore 11: +%Since symfony/serializer 6\.4: Passing a "Doctrine\\Common\\Annotations\\PsrCachedReader" instance as argument 1 to "Symfony\\Component\\Serializer\\Mapping\\Loader\\AttributeLoader::__construct\(\)" is deprecated, pass null or omit the parameter instead% +%Since symfony/validator 6\.4: Method "Symfony\\Component\\Validator\\ValidatorBuilder::setDoctrineAnnotationReader\(\)" is deprecated without replacement% +%Since symfony/routing 6\.4: Passing an instance of "Doctrine\\Common\\Annotations\\Reader" as first and the environment as second argument to "Symfony\\Component\\Routing\\Loader\\AttributeClassLoader::__construct" is deprecated\. Pass the environment as first argument instead% + +# Remaining "direct" deprecation notices with Pimcore 11 & 12: +%Since pimcore/skeleton 11\.2\.0: For consistency purpose, it is recommended to use the autoload from Symfony Runtime in project root "bin/console"% +%The "Pimcore\\Bundle\\InstallBundle\\Installer" class is considered internal\. It may change without further notice\. You should not use it from "Neusta\\Pimcore\\TestingFramework\\Database\\PimcoreInstaller"% + +# Remaining "direct" deprecation notices with Pimcore 12: +%Since pimcore/admin-ui-classic-bundle 2\.3: The AdminUiClassicBundle is deprecated and will be discontinued with Pimcore Studio%