Download the PHP package peridot-php/peridot-code-coverage-reporters without Composer
On this page you can find all versions of the php package peridot-php/peridot-code-coverage-reporters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download peridot-php/peridot-code-coverage-reporters
More information about peridot-php/peridot-code-coverage-reporters
Files in peridot-php/peridot-code-coverage-reporters
Package peridot-code-coverage-reporters
Short Description Code coverage reporters for Peridot PHP.
License MIT
Informations about the package peridot-code-coverage-reporters
Peridot Code Coverage Reporters
Installation
Add this package as a dependency:
composer require --dev peridot-php/peridot-code-coverage-reporters
Then register the reporters in your peridot.php
configuration:
Usage
This package provides several Peridot reporters that can be used via the
--reporter
option:
html-code-coverage
text-code-coverage
clover-code-coverage
xml-code-coverage
crap4j-code-coverage
php-code-coverage
These reporters are all driven by php-code-coverage, which requires the use of
either the phpdbg
executable, or the xdebug
PHP extension in order to
produce coverage reports.
With phpdbg
Where available, phpdbg
is generally recommended for faster coverage
reporting. Most system-level package management tools should be able to install
a version of phpdbg
with minimal hassle. Under Homebrew, for example,
phpdbg
can be installed like so:
brew tap homebrew/homebrew-php && brew install php71 --with-phpdbg
Once installed, phpdbg -qrr
can be used in place of php
when executing
scripts, including the peridot
binary, allowing code coverage to be generated:
phpdbr -qrr vendor/bin/peridot --reporter spec --reporter html-code-coverage
The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed.
With xdebug
Use of xdebug
is no longer recommended, because of the significantly worse
performance compared to phpdbg
. If phpdbg
is not an option, simply make sure
the xdebug
extension is enabled when running peridot
:
vendor/bin/peridot --reporter spec --reporter html-code-coverage
The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed.