PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Invalid mocking target

Last modified: 16 May 2022

Reports the methods and classes that are incorrectly mocked in PHPUnit tests.

The following entities are reported:

  • Enums and final classes

  • private, static, or final methods

  • Duplicate methods provided in the mocked methods lists via addMethods(), onlyMethods(), setMethods(), and so on.