Skip to content

Conversation

@dominikkaluza
Copy link
Collaborator

@dominikkaluza dominikkaluza commented Dec 17, 2025

Mockery recommends either the trait usage or the test case base class - https://docs.mockery.io/en/stable/reference/phpunit_integration.html#phpunit-integration.

In my opinion, the base class is safer and more reliable.

We've run into issues where the trait was missing even though we have a PHPStanrule for that, for example the expectation might be in some helper class which the current rule won't catch.

I'm not including the rule in phpstan-extension.neon since it causes too many errors on our current codebases, it's up to the consumer to include it in the configuration.

@dominikkaluza dominikkaluza changed the title DE-151249 Add TestsExtendMockeryTestCaseRule which enforces a Mockery base testcase class DE-151249 Add TestsExtendMockeryTestCaseRule which enforces a Mockery base test case class Dec 17, 2025
@dominikkaluza dominikkaluza force-pushed the DE-151249-phpstan-mockery-test-case-rule branch from edce304 to f734784 Compare December 17, 2025 12:37
@dominikkaluza dominikkaluza enabled auto-merge (squash) December 17, 2025 13:11
@dominikkaluza dominikkaluza merged commit e724e10 into master Dec 17, 2025
19 checks passed
@dominikkaluza dominikkaluza deleted the DE-151249-phpstan-mockery-test-case-rule branch December 17, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants