Skip to content

PHPUnit 11 deprecations #60

@Jean85

Description

@Jean85

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 @postCondition and @after annotations here:

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 assertPostCondition and tearDown 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)
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions