PHPUnit Code coverage targets testing class, not tested class
Hello,
I have a problem generating and obtaining code coverage. My code coverage covers not tested class, but class that actually tests (so AxaAnnextTest.php class). May I misconfigured something?



I can see coverage on testing class, not tested class.
请先登录再写评论。
Probably you've defined the whitelist wrongly at phpunit.xml. Can we take a look at it?
Here it is:
Try to add a
--whitelist <target_class_name>(e.g.--whitelist AxaAnnex) option to a test runner in your PhpUnit run configuration.Test still covers testing class, not tested class. Those are my files:
I've got an test folder with testing class.
On the same level of tree, I've got "src" folder with domains inside. I test everything from /src/Domain/Insurance folder.
This configuration finally worked: