From 891288878746073a6134088a0e066f0f0f0fa27b Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Fri, 24 Apr 2026 16:33:59 +0200 Subject: [PATCH 1/4] feat: allow PHPUnit ^11.5.11 in composer dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 50e22cf..cb6c75b 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "doctrine/persistence": "^3.1", - "phpunit/phpunit": "^9.6 || ^10.5", + "phpunit/phpunit": "^9.6 || ^10.5 || ^11.5.11", "pimcore/admin-ui-classic-bundle": "^1.6 || ^2.0", "pimcore/pimcore": "^11.5 || ^12.0", "psr/log": "^2.0 || ^3.0", From 52245379b8e8d9b91744a5e565f1aab05e3febb3 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Tue, 5 May 2026 13:39:31 +0200 Subject: [PATCH 2/4] feat: extend test matrix to include PHPUnit ^11.5.11 --- .github/workflows/tests.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ec5bcbd..f3293db 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,11 +20,13 @@ jobs: matrix: php-version: [ "8.1", "8.2", "8.3", "8.4" ] pimcore-version: [ "^11.5", "^12.0" ] - phpunit-version: [ "^9.6", "^10.5" ] + phpunit-version: [ "^9.6", "^10.5", "^11.5.11" ] dependencies: [ "highest" ] exclude: - php-version: "8.1" pimcore-version: "^12.0" + - php-version: "8.1" + phpunit-version: "^11.5.11" - php-version: "8.2" pimcore-version: "^12.0" - php-version: "8.4" @@ -46,6 +48,10 @@ jobs: pimcore-version: "^12.0" phpunit-version: "^10.5" dependencies: "lowest" + - php-version: "8.3" + pimcore-version: "^12.0" + phpunit-version: "^11.5.11" + dependencies: "lowest" env: MYSQL_HOST: 127.0.0.1 From fba2885acce0ad355bf28f2df30a0df03d661606 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Tue, 5 May 2026 16:29:53 +0200 Subject: [PATCH 3/4] fix: register Symfony's exception handler already in test bootstrap This fixes PHPUnit's complaint: > Test code or tested code did not remove its own exception handlers See: https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145 --- composer.json | 3 ++- tests/bootstrap.php | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cb6c75b..6572672 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,8 @@ "phpstan/phpstan-phpunit": "^2.0.16", "phpstan/phpstan-symfony": "^2.0.15", "shipmonk/composer-dependency-analyser": "^1.7", - "symfony/http-foundation": "^6.4 || ^7.3" + "symfony/http-foundation": "^6.4 || ^7.3", + "symfony/error-handler": "^6.4 || ^7.3" }, "conflict": { "pimcore/pimcore": ">=11.2.0 <11.2.2" diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3083da1..e9b2e3d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,9 +4,14 @@ use Neusta\Pimcore\TestingFramework\Kernel\TestKernel; use Neusta\Pimcore\TestingFramework\Pimcore\BootstrapPimcore; +use Symfony\Component\ErrorHandler\ErrorHandler; include dirname(__DIR__) . '/vendor/autoload.php'; +// This fixes PHPUnit's complaint: "Test code or tested code did not remove its own exception handlers" +// See: https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145 +set_exception_handler([new ErrorHandler(), 'handleException']); + BootstrapPimcore::bootstrap( PIMCORE_PROJECT_ROOT: __DIR__ . '/app', KERNEL_CLASS: TestKernel::class, From 688f95c66b1e5607680df30147fc5a5ce0fce5bb Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Tue, 5 May 2026 17:19:05 +0200 Subject: [PATCH 4/4] fix: install `symfony/runtime` instead of registering Symfony's exception handler Just the availability of Symfony's runtime component fixes it, even if we don't use it anywhere ourselves. --- composer.json | 23 ++++++++++++----------- tests/bootstrap.php | 5 ----- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 6572672..7f6a7b6 100644 --- a/composer.json +++ b/composer.json @@ -25,14 +25,14 @@ "pimcore/admin-ui-classic-bundle": "^1.6 || ^2.0", "pimcore/pimcore": "^11.5 || ^12.0", "psr/log": "^2.0 || ^3.0", - "symfony/config": "^6.4 || ^7.3", - "symfony/console": "^6.4 || ^7.3", - "symfony/dependency-injection": "^6.4 || ^7.3", - "symfony/event-dispatcher": "^6.4 || ^7.3", - "symfony/filesystem": "^6.4 || ^7.3", - "symfony/framework-bundle": "^6.4.1 || ^7.3", - "symfony/http-kernel": "^6.4 || ^7.3", - "symfony/routing": "^6.4 || ^7.3" + "symfony/config": "^6.4.13 || ^7.3", + "symfony/console": "^6.4.13 || ^7.3", + "symfony/dependency-injection": "^6.4.13 || ^7.3", + "symfony/event-dispatcher": "^6.4.13 || ^7.3", + "symfony/filesystem": "^6.4.13 || ^7.3", + "symfony/framework-bundle": "^6.4.13 || ^7.3", + "symfony/http-kernel": "^6.4.13 || ^7.3", + "symfony/routing": "^6.4.13 || ^7.3" }, "require-dev": { "dama/doctrine-test-bundle": "^7.2 || ^8.0", @@ -45,8 +45,8 @@ "phpstan/phpstan-phpunit": "^2.0.16", "phpstan/phpstan-symfony": "^2.0.15", "shipmonk/composer-dependency-analyser": "^1.7", - "symfony/http-foundation": "^6.4 || ^7.3", - "symfony/error-handler": "^6.4 || ^7.3" + "symfony/http-foundation": "^6.4.13 || ^7.3", + "symfony/runtime": "^6.4.13 || ^7.3" }, "conflict": { "pimcore/pimcore": ">=11.2.0 <11.2.2" @@ -69,7 +69,8 @@ "endroid/installer": true, "ergebnis/composer-normalize": true, "php-http/discovery": true, - "phpstan/extension-installer": true + "phpstan/extension-installer": true, + "symfony/runtime": false }, "audit": { "block-insecure": false diff --git a/tests/bootstrap.php b/tests/bootstrap.php index e9b2e3d..3083da1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,14 +4,9 @@ use Neusta\Pimcore\TestingFramework\Kernel\TestKernel; use Neusta\Pimcore\TestingFramework\Pimcore\BootstrapPimcore; -use Symfony\Component\ErrorHandler\ErrorHandler; include dirname(__DIR__) . '/vendor/autoload.php'; -// This fixes PHPUnit's complaint: "Test code or tested code did not remove its own exception handlers" -// See: https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145 -set_exception_handler([new ErrorHandler(), 'handleException']); - BootstrapPimcore::bootstrap( PIMCORE_PROJECT_ROOT: __DIR__ . '/app', KERNEL_CLASS: TestKernel::class,