CodeCoverage with PHPunit does not generate

PHPunit 3.7.1 PHP 5.3.14 Windows 7

Using cmd i "cd" in the directory where phpunit.xml lives and runs

phpunit -c phpunit.xml 

but does not generate any code coverage.

phpunit.xml:

 <phpunit bootstrap="./bootstrap.php" verbose="true" > <testsuites> <testsuite name="Test Suite"> <directory suffix=".php">./Base/src/</directory> <filter> <whitelist addUncoveredFilesFromWhitelist="true"> <directory suffix=".php">../src</directory> <exclude> <directory suffix=".php">../../vendor</directory> </exclude> </whitelist> </filter> <logging> <log type="coverage-html" target="./CodeCoverage/"/> </logging> </testsuite> </testsuites> </phpunit> 

when i run

 phpunit -c phpunit.xml --coverage-html CodeCoverage 

which works fine but nothing works in the filter.

What am I doing wrong here?

+2
source share
1 answer

I don't know if phpunit supports filter definition and logging inside testuite. Defining all of this on it should work:

 <phpunit bootstrap="./bootstrap.php" verbose="true"> <testsuites> <testsuite name="Test Suite"> <directory suffix=".php">./Base/src/</directory> </testsuite> </testsuites> <filter> <whitelist addUncoveredFilesFromWhitelist="true"> <directory suffix=".php">../src</directory> <exclude> <directory suffix=".php">../../vendor</directory> </exclude> </whitelist> </filter> <logging> <log type="coverage-html" target="./CodeCoverage/"/> </logging> </phpunit> 
+3
source

All Articles