Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit whitelist code coverage

The whitelist isn't working how I would expect when get code coverage reports. I am using Zend Framework and my Zend files are also in the library directory just like the project quickstart.

I'm running PHPUnit 3.6 from Netbeans 7.0.1

I only really want to see the coverage for the classes for MyLib.

<whitelist>
    <directory suffix=".php">../../library/MyLib</directory>
</whitelist>

But in the report I seem to get a percentage value for several Zend files eg. Zend_Controller_Front, Zend_Loader_Autoloader etc.

Obviously I haven't written any tests for these classes and it is no surprise that I have 0% coverage.

What have I missed?

like image 698
gawpertron Avatar asked Dec 07 '11 11:12

gawpertron


1 Answers

Please use absolute paths in your XML file and/or ensure those are correctly resolved by your phpunit test-runner call. Also ensure that your XML file is loaded.

like image 138
hakre Avatar answered Sep 24 '22 03:09

hakre