-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPUnit 11 deprecations #60
Comments
We should not use @sebastianbergmann would it work to apply both the attribute and the phpdoc tag as a way to support PHPUnit 9 and 11 at the same time, or would this register the methods twice for PHPUnit 10+ ? |
IMO using both would could trigger the deprecations anyway, so it would not solve our issue... |
Well, that's what I'd like to confirm. It would be great if PHPUnit could support the case of applying both as a way to support multiple versions (basically ignoring the phpdoc tag if the attribute is applied). |
@Jean85 Sebastian answered on the PHPUnit ticket. Defining both the attribute and the annotation on the method is the way to go to support multiple versions. PHPUnit 10+ ignores the annotation entirely when the attribute is present. |
I'm closing this issue as the solution for those deprecations is found. Please update #59 to add the attribute without removing the annotation. |
I've already opened #59 + phpspec/prophecy#616 to allow PHPUnit 11 compatibility, but I've already found that the
ProphecyTrait
triggers deprecations in that case. It triggers 2 deprecations for each test execution, so that A LOT of noise, especially if data providers are involved.As already (wrongly) reported in sebastianbergmann/phpunit#5693 (comment),
Those annotations can be replaced by attributes since PHPUnit 10.0.0, or you can replace it with using the
assertPostCondition
andtearDown
methods.So, I'm asking, how should we proceed? I see 3 possibilities:
assertPostCondition
andtearDown
methods, so that we don't drop support for older versions (but we mess with the inheritance chain of those methods, and the user could inadvertently deactivate that code path)WDYT? ping @stof
The text was updated successfully, but these errors were encountered: