Download the PHP package henrikbjorn/phpspec-code-coverage without Composer
On this page you can find all versions of the php package henrikbjorn/phpspec-code-coverage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download henrikbjorn/phpspec-code-coverage
More information about henrikbjorn/phpspec-code-coverage
Files in henrikbjorn/phpspec-code-coverage
Package phpspec-code-coverage
Short Description Integrates CodeCoverage with PhpSpec
License MIT
Informations about the package phpspec-code-coverage
PhpSpec Code Coverage
DEPRECATED: CodeCoverage should not be used with spec testing in order to see how good your tests are. For that reason, and because I don't use it myself, this library is deprecated and will not receive any updates etc. For a maintained fork, you can check leanphp/phpspec-code-coverage.
Install with Composer:
Enable it in your phpspec.yml
file:
Now run your specs with the normal phpspec run
and voilà your code coverage will be available in
coverage
.
Configuration Options
It is possible to control a bit out how the code coverage is done through phpspec.yml
. This is done by
adding a hash of options to the extension key.
whitelist
takes an array of directories to whitelist (default:lib
,src
).whitelist_files
takes an array of files to whitelist (default: none).blacklist
takes an array of directories to blacklistblacklist_files
takes an array of files to blacklistformat
(optional) could be one or many of:clover
,php
,text
,html
(defaulthtml
)-
output
takes a location relative to the place you are runningphpspec run
(default:coverage
). If you configure multiple formats, takes a hash of format:output e.g. show_uncovered_files
for including uncovered files in coverage reports (defaulttrue
)lower_upper_bound
for coverage (default35
)high_lower_bound
for coverage (default70
)
Note: If the clover format option requires you to also set an output location!
Running with phpdbg (PHP 7.x and up)
For faster execution, run phpspec with phpdbg instead of xdebug:
Note: The code coverage extension only works with phpdbg if you're using PHP 7. In PHP 5.6, phpdbg is missing the phpdbg_start_oplog function which is required to generate code coverage.
All versions of phpspec-code-coverage with dependencies
phpspec/phpspec Version ^3.0
phpunit/php-code-coverage Version ^4.0