June 2017
Intermediate to advanced
536 pages
9h 49m
English
The great thing about PHPUnit is its code coverage reporting functionality. We can easily add code coverage to our testing suite just by extending the phpunit.xml file as follows:
<phpunit bootstrap="autoload.php"> <testsuites> <testsuite name="foggyline"> <directory>src/Foggyline/*/Test/Unit/*</directory> </testsuite> </testsuites> <filter> <whitelist> <directory>src/Foggyline/</directory> <exclude> <file>src/config.php</file> <file>src/auth.php</file> <directory>src/Foggyline/*/Test/</directory> </exclude> </whitelist> <logging> <log type="coverage-html" target="log/report" lowUpperBound="50" highLowerBound="80"/> </logging> </filter></phpunit>
Here, we added the filter element, with an extra whitelist and logging element. ...
Read now
Unlock full access