Skip to content

Releases: Lendable/phpunit-extensions

0.3.1

01 May 11:04
153d966
Compare
Choose a tag to compare

What's Changed

What's Fixed

  • Don't add DisableReturnValueGenerationForTestDoubles to abstract classes via Rector by @ben-challis in #78

Full Changelog: 0.3.0...0.3.1

0.3.0

19 Apr 09:27
5337285
Compare
Choose a tag to compare

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

0.2.0

02 Dec 10:55
49987c4
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.1.0...0.2.0

0.1.0

26 Nov 22:32
b8d7319
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: https://github.com/Lendable/phpunit-extensions/commits/0.1.0