mickey135 9e3b5098e2 feat:初始化sz地铁 | há 1 mês atrás | |
---|---|---|
.. | ||
.github | há 1 mês atrás | |
src | há 1 mês atrás | |
tests | há 1 mês atrás | |
.gitattributes | há 1 mês atrás | |
.gitignore | há 1 mês atrás | |
.php_cs.dist | há 1 mês atrás | |
.travis.yml | há 1 mês atrás | |
ChangeLog.md | há 1 mês atrás | |
LICENSE | há 1 mês atrás | |
README.md | há 1 mês atrás | |
build.xml | há 1 mês atrás | |
composer.json | há 1 mês atrás | |
phive.xml | há 1 mês atrás | |
phpunit.xml | há 1 mês atrás |
SebastianBergmann\CodeCoverage is a library that provides collection, processing, and rendering functionality for PHP code coverage information.
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
<?php
use SebastianBergmann\CodeCoverage\CodeCoverage;
$coverage = new CodeCoverage;
$coverage->filter()->addDirectoryToWhitelist('/path/to/src');
$coverage->start('<name of test>');
// ...
$coverage->stop();
$writer = new \SebastianBergmann\CodeCoverage\Report\Clover;
$writer->process($coverage, '/tmp/clover.xml');
$writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade;
$writer->process($coverage, '/tmp/code-coverage-report');