Repository navigation
feat: Add support for Behat 3.x - #9
Merged
Merged
Conversation
This extension supports PHPUnit 11-13, which are broken even with the built-in PHPUnit support on Behat 3.x. Therefore, we should make this extension available for Behat 3.x as well. As it stands, that will enable the PHPUnit bootstrapping required to get 11-13 working. However it will still use Behat 3's built-in stringer, as that is registered first. Once we release the extension, we can update Behat 3.x so that: * The built-in ExceptionExtension doesn't register the built-in PHPUnitExceptionStringer if this extension is installed and enabled. * The built-in PHPUnitExceptionStringer emits a Behat deprecation recommending this extension if it receives an assertion failure. * We can simplify the Behat docs to remove details of the old workaround and instead point people to this extension for all Behat versions. End-users who install the extension with Behat 3.x will immediately benefit from better PHPUnit support, and will have a smoother upgrade path to 4.0. It also means we don't have to consider / make changes to the old core stringer in 3.x even if it stops working with future PHPUnit releases - we can just point people to this extension where it should be easier to deliver a fix.
acoulton
marked this pull request as ready for review
September 20, 2026 16:32
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.
This extension supports PHPUnit 11-13, which are broken even with the built-in PHPUnit support on Behat 3.x.
Therefore, we should make this extension available for Behat 3.x as well. As it stands, that will enable the PHPUnit bootstrapping required to get 11-13 working. However it will still use Behat 3's built-in stringer, as that is registered first.
Once we release the extension, we can update Behat 3.x so that:
End-users who install the extension with Behat 3.x will immediately benefit from better PHPUnit support, and will have a smoother upgrade path to 4.0.
It also means we don't have to consider / make changes to the old core stringer in 3.x even if it stops working with future PHPUnit releases - we can just point people to this extension where it should be easier to deliver a fix.
Note, we can't just forcibly add this as a Behat 3.x composer dependency (which would sometimes be an option for splitting features out of a package), because it introduces a hard dependency on PHPUnit and therefore can only be an end-user opt-in.