Inspectopedia
 
2024.3

Invalid PHPUnit mocking target

Error
New
Last modified: 03 December 2024

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.