Releases: Lendable/phpunit-extensions
Releases · Lendable/phpunit-extensions
0.3.1
What's Changed
- Relax
phpunit/phpunit
requirement to^11.1
by @ben-challis in #77
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
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 callcreateStrictMock()
explicitly. The PHPStan rules bundled will enforce this usage if the trait is used. - Extend the
TestCase
abstract class provided, and callcreateStrictMock()
explicitly. The PHPStan rules bundled will enforce this usage if this class is extended from. - Add
#[DisableReturnValueGenerationForTestDoubles]
to your test cases. The Rector ruleEnforceDisableReturnValueGenerationForTestDoublesRector
shipped will enforce/automate adding this to be added to all test cases.
Full Changelog: 0.2.0...0.3.0
0.2.0
What's Changed
- Add PHPStan rule enforcing strict mocking by @marmichalski in #11
Full Changelog: 0.1.0...0.2.0
0.1.0
What's Changed
- Add stricter mocking by @ben-challis, @marmichalski in #2
New Contributors
- @ben-challis made their first contribution in #2
- @marmichalski made their first contribution in #2
Full Changelog: https://github.com/Lendable/phpunit-extensions/commits/0.1.0