-
Notifications
You must be signed in to change notification settings - Fork 41
Description
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),
[...] the causes are the
@postConditionand@afterannotations here:
prophecy-phpunit/src/ProphecyTrait.php
Lines 57 to 60 in 29f8114
/** * @postCondition */ protected function verifyProphecyDoubles(): void prophecy-phpunit/src/ProphecyTrait.php
Lines 75 to 78 in 29f8114
/** * @after */ protected function tearDownProphecy(): void
Those annotations can be replaced by attributes since PHPUnit 10.0.0, or you can replace it with using the assertPostCondition and tearDown methods.
So, I'm asking, how should we proceed? I see 3 possibilities:
- we switch to the
assertPostConditionandtearDownmethods, 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) - we switch to attributes, dropping support for PHPUnit 9
- we do a mix, adding the methods but invoking the sub-methods only for PHPUnit 9, leaving the rest to the attributes
WDYT? ping @stof