Github url

php-code-coverage

by sebastianbergmann

sebastianbergmann /php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage info...

7.4K Stars 306 Forks Last release: Not found Other 1.9K Commits 144 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

phpunit/php-code-coverage

Latest Stable VersionCI StatusType Coverage

Provides collection, processing, and rendering functionality for PHP code coverage information.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require phpunit/php-code-coverage

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev phpunit/php-code-coverage

Usage

<?php use SebastianBergmann\CodeCoverage\CodeCoverage;

$coverage = new CodeCoverage;

$coverage->filter()-\>includeDirectory('/path/to/src'); $coverage-\>start('<name of test>');

// ...

$coverage-&gt;stop();

$writer = new \SebastianBergmann\CodeCoverage\Report\Clover;
$writer-&gt;process($coverage, '/tmp/clover.xml');

$writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade;
$writer-&gt;process($coverage, '/tmp/code-coverage-report');
</name>

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.