Repository navigation
feat: Add support for PHPUnit 11 - 13 - #6
Merged
Merged
Conversation
acoulton
added this pull request to stack #3
September 17, 2026 15:18
acoulton
force-pushed
the
phpunit-11-13
branch
from
September 17, 2026 15:21
4ba04f0 to
67ba51a
Compare
acoulton
marked this pull request as ready for review
September 17, 2026 15:21
Contributor
Author
|
For clarity, we'd still advise people NOT to use PHPUnit for assertions in new projects. We'd also make clear that there are no guarantees we will (or will be able to) support future PHPUnit releases. However, since we can get the current known majors working I think we should at least support those, rather than blocking existing projects on older PHPUnit versions until they migrate their Behat assertions to another tool. |
acoulton
force-pushed
the
phpunit-11-13
branch
2 times, most recently
from
September 18, 2026 17:00
21f6a2d to
221d14b
Compare
carlos-granados
left a comment
There was a problem hiding this comment.
Looking good @acoulton just some tiny changes needed
| @@ -0,0 +1,32 @@ | |||
| @phpunit-11 | |||
| Feature: PHPUnit assertions are rendered as expected with PHPUnit 10 | |||
| @@ -0,0 +1,32 @@ | |||
| @phpunit-12 | |||
| Feature: PHPUnit assertions are rendered as expected with PHPUnit 10 | |||
| @@ -0,0 +1,32 @@ | |||
| @phpunit-13 | |||
| Feature: PHPUnit assertions are rendered as expected with PHPUnit 10 | |||
These are the versions that introduced the requirement to bootstrap PHPUnit's configuration before stringifying most assertion failures - and which finally prompted us to advise against using PHPUnit for Behat assertions. We published a workaround for this in the docs https://docs.behat.org/en/latest/useful_resources.html#assertion-tools - but now that we enforce the supported PHPUnit versions, and know that the end-user wants to use PHPUnit assertions, I think it's reasonable to do the bootstrapping within our extension. I've done that within the first BeforeSuite event, so that if it triggers an error in future that should be detected in a test report rather than e.g. being a fatal Behat crash.
acoulton
force-pushed
the
phpunit-11-13
branch
from
September 20, 2026 08:08
221d14b to
d3a2a50
Compare
Contributor
Author
|
Thanks @carlos-granados, good catch - sorry I didn't spot them. Fixed now |
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.
These are the versions that introduced the requirement to bootstrap PHPUnit's configuration before stringifying most assertion failures - and which finally prompted us to advise against using PHPUnit for Behat assertions.
We published a workaround for this in the docs
https://docs.behat.org/en/latest/useful_resources.html#assertion-tools
I've done that within the first BeforeSuite event, so that if it triggers an error in future that should be detected in a test report rather than e.g. being a fatal Behat crash.