PhpSpec Code Coverage
Add it to your composer.json file to install with Composer:
{
"require" : {
"henrikbjorn/phpspec-code-coverage" : "1.0@dev"
}
}$ composer update henrikbjorn/phpspec-code-coverageEnable it in your phpspec.yml file:
extensions:
- PhpSpec\Extension\CodeCoverageExtensionNow run your specs with the normal phpspec run and voila your code coverage will be available in
coverage.
It is possible to control a bit out how the code coverage is done through phpspec.yml. This is done by
adding a code_coverage key which takes a hash of options.
whitelisttakes an array of directories to whitelist (default:lib,src).blacklisttakes an array of directories to blacklist (default:test,spec,vendor).outputtakes a location relative to the place you are runningphpspec run(default:coverage).