PHPUnit coverage is now incomplete since the class opening bracket does not extend

Hi everyone, I am using PHPUnit to do unit testing in the Symfony / Doctrine project I'm working on. It worked fine until yesterday, when various classes dropped from 100% coverage to 98-99%. The reason for the change is that the open left bracket of these classes for some reason is no longer considered "covered." Here is a screenshot of the problems:

http://imgur.com/RCDzm.png

I tried everything, but I can’t understand what causes some classes to have this problem, while others show "full" coverage just fine. This is more annoying than anything, since the tests still work very well, but it would be nice to know what is going on. I use PHP 5.3.2, PHPUnit v3.4.15 and Xdebug v2.1.0 in case that matters.

+4
source share
1 answer

Probably related to

Sebastian noted this as wontfix in PHPUnit, and Derick says this is not a mistake.

It's not a mistake. Xdebug can only scan elements (files, functions, methods) when they are loaded, and code coverage is enabled. The class file is loaded before code coverage is enabled and therefore does not appear in the coverage report. Methods are scanned when they run, so it works there.

+6
source

Source: https://habr.com/ru/post/1316353/


All Articles