lint/phpunit/no-stub-with-expectations
In the lint-recommended preset and every stricter one. In Rector’s rector-phpunit/composer-based, rector-phpunit/phpunit-mock-to-stub sets. Needs the phpunit extension. Safe fix.
What it does
Change createStub() to createMock(), when the created variable is passed to a method that requires MockObject type
Configuration
[lint.rules]
"phpunit/no-stub-with-expectations" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Replaces
MockObjectArgCreateStubToCreateMock(rector-phpunit)