Skip to content

0.3.0

Compare
Choose a tag to compare
@ben-challis ben-challis released this 19 Apr 09:27
· 53 commits to main since this release
5337285

What's Changed

Updated for PHPUnit 11. This is has required a major shift away from overriding createMock and requiring extension or trait usage via static analysis. This is due to (understandably) PHPUnit making their internal methods final.

To enforce not using return value generation for test doubles, and error out instead, you have 3 options:

  • Use the StrictMocking trait, and call createStrictMock() explicitly. The PHPStan rules bundled will enforce this usage if the trait is used.
  • Extend the TestCase abstract class provided, and call createStrictMock() explicitly. The PHPStan rules bundled will enforce this usage if this class is extended from.
  • Add #[DisableReturnValueGenerationForTestDoubles] to your test cases. The Rector rule EnforceDisableReturnValueGenerationForTestDoublesRector shipped will enforce/automate adding this to be added to all test cases.

Full Changelog: 0.2.0...0.3.0