Open
Conversation
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 pestphp#342 tracks removing that conflict. Once collision is updated, this constraint will resolve cleanly.
This was referenced Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Widens the PHPUnit version constraint to accept
^13.0alongside^12.5.8, and updates the conflict rule from>12.5.8to>13.1.Code audit
I audited every PHPUnit class/interface that Pest imports across
src/:BeforeFirstTestMethodErrored,AfterLastTestMethodErrored,Errored,Failed,Skipped,ConsideredRisky,MarkedIncomplete) and their subscriber interfaces retain the samePHPUnit\Event\Testnamespace and API in PHPUnit 13.testClassName(): Still present on errored hook events — PHPUnit 13 only removed it from "called"/"finished" hook events, which Pest doesn't use.TextUI\Application,Configuration\Registry,TestResult\Facade,CliArguments\Builder,XmlConfigurationFileFinder,XmlConfiguration\DefaultConfiguration,XmlConfiguration\Loader,Util\ExcludeList— all retain their namespaces and method signatures in PHPUnit 13.Assert::isType(),assertContainsOnly(),containsOnly(),#[RunClassInSeparateProcess],--dont-report-useless-tests— none are used in Pest's source.Dependency note
nunomaduro/collision ^8.8.3currently conflicts withphpunit/phpunit >=13.0.0. Collision PR #342 tracks adding PHPUnit 13 support there. Once collision updates its conflict list, this constraint will resolve cleanly.The circular dependency (Pest → Collision → PHPUnit 13 blocked → Pest) needs to be broken — this PR breaks it from the Pest side. Collision can then update independently since Pest is only a dev dependency there.
PHPUnit 13 key changes (for reference)
PHPUnit 13 requires PHP 8.4+. Removed APIs:
Assert::isType(),assertContainsOnly(),assertNotContainsOnly(),containsOnly()testClassName()on called/finished hook events (NOT errored events)Configuration::includeTestSuite()/excludeTestSuite()#[RunClassInSeparateProcess]attribute--dont-report-useless-testsCLI optionNone of these affect Pest's runtime code.