lint/phpunit/prefer-create-mock
In the lint-strict preset. In Rector’s rector-phpunit/composer-based set. Needs the phpunit extension. Unsafe fix: it can change behavior.
What it does
Replace getMock*() with createMock().
Configuration
[lint.rules]
"phpunit/prefer-create-mock" = "error"
To skip it in some files, add an override or a @pun-ignore-file comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
target |
enum |
5.4, 5.5, newest |
"newest" |
target |
Replaces
php_unit_mock(php-cs-fixer, risky)GetMock(rector-phpunit)