XDebug and PHPUnit getting code coverage wrong

I am using php 5.5.9 on Ubuntu 14.04. I updated Xdebug to the version the Wizard recommends, which is version 2.2.6, and I used apt-get to make sure my Ubuntu system is up to date. The problem, however, is that my lines of code cover lines that get executed when they are clearly not.

Here are the offensive lines:

    if(!$filter->isValid()) {
        throw new Exception\InvalidInput($this->formatFilterErrors($filter));
    }

      

I know that the conditional code inside the if statement is not executed as the filtered data is always valid. I can prove this by putting echo or stamp expressions in a block of code (above the throw statement) and they never get executed.

So why is code coverage telling me that the throw statement is being executed, many times?

While I only have one example of incorrect reporting, I really need to sort this out as a priority since I have a lot of trials for this application. I could try updating PHP (but this of course has other implications). Also, my only option is to raise, but with a developer.

Have you encountered this error? I've heard of other issues with Xdebug on Ubuntu 14.04, but the Xdebug update has cleared up their issues.

+3
php xdebug testing


source to share


No one has answered this question yet

Check out similar questions:

2263
How to get YouTube video thumbnail using YouTube API?
1624
How do I get PHP errors?
34
Achieving 100% code coverage with PHPUnit
2
Analyzing xdebug code coverage with the simpletest framework
2
PhpUnit code coverage not working - MacOs Sierra
2
Failed to install xdebug on Ubuntu 12.04 LTS
1
How to generate PHP code coverage reports from xdebug output
0
What causes differences in PHPUnit code coverage reports for the same code base?
0
PHPUnit exits with error code 255 only when run with Xdebug enabled
0
PHPUnit, Code Coverage, xdebug and html reports



All Articles
Loading...
X
Show
Funny
Dev
Pics