From 843a17b733ed17e3b3c7da82e9ee55cae14fff25 Mon Sep 17 00:00:00 2001 From: David Bebawy Date: Tue, 10 Feb 2026 11:34:37 -0500 Subject: [PATCH] Support PHPUnit 13 Widen the PHPUnit version constraint to also accept ^13.0 alongside ^12.5.8. Update the conflict rule accordingly. Code audit of Pest's PHPUnit integration surface: - All PHPUnit Event classes used by Pest (BeforeFirstTestMethodErrored, AfterLastTestMethodErrored, Errored, Failed, Skipped, ConsideredRisky, MarkedIncomplete, and all subscribers) retain the same namespace and API in PHPUnit 13. - testClassName() on errored hook events is NOT among the removed methods (only removed from "called"/"finished" hook events). - Internal APIs (TextUI\Application, Configuration\Registry, TestResult\Facade, CliArguments\Builder, XmlConfigurationFileFinder, XmlConfiguration\DefaultConfiguration, XmlConfiguration\Loader, Util\ExcludeList) all retain their namespaces and method signatures. - None of the removed PHPUnit 13 APIs (Assert::isType(), assertContainsOnly(), containsOnly(), #[RunClassInSeparateProcess], --dont-report-useless-tests) are used by Pest. Note: nunomaduro/collision ^8.8.3 currently conflicts with PHPUnit 13. Collision PR #342 tracks removing that conflict. Once collision is updated, this constraint will resolve cleanly. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9d7fcdee..7a1348f1 100644 --- a/composer.json +++ b/composer.json @@ -25,12 +25,12 @@ "pestphp/pest-plugin-arch": "^4.0.0", "pestphp/pest-plugin-mutate": "^4.0.1", "pestphp/pest-plugin-profanity": "^4.2.1", - "phpunit/phpunit": "^12.5.8", + "phpunit/phpunit": "^12.5.8 || ^13.0", "symfony/process": "^7.4.4|^8.0.0" }, "conflict": { "filp/whoops": "<2.18.3", - "phpunit/phpunit": ">12.5.8", + "phpunit/phpunit": ">13.1", "sebastian/exporter": "<7.0.0", "webmozart/assert": "<1.11.0" },