|
1 | | -# phpunit/php-code-coverage |
2 | | - |
3 | | -[](https://packagist.org/packages/phpunit/php-code-coverage) |
4 | | -[](https://github.com/sebastianbergmann/php-code-coverage/actions) |
5 | | -[](https://shepherd.dev/github/sebastianbergmann/php-code-coverage) |
6 | | -[](https://codecov.io/gh/sebastianbergmann/php-code-coverage) |
7 | | - |
8 | | -Provides collection, processing, and rendering functionality for PHP code coverage information. |
9 | | - |
10 | | -## Installation |
11 | | - |
12 | | -You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): |
13 | | - |
14 | | -``` |
15 | | -composer require phpunit/php-code-coverage |
16 | | -``` |
17 | | - |
18 | | -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: |
19 | | - |
20 | | -``` |
21 | | -composer require --dev phpunit/php-code-coverage |
22 | | -``` |
23 | | - |
24 | | -## Usage |
25 | | - |
26 | | -```php |
27 | | -<?php declare(strict_types=1); |
28 | | -use SebastianBergmann\CodeCoverage\Filter; |
29 | | -use SebastianBergmann\CodeCoverage\Driver\Selector; |
30 | | -use SebastianBergmann\CodeCoverage\CodeCoverage; |
31 | | -use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport; |
32 | | - |
33 | | -$filter = new Filter; |
34 | | -$filter->includeDirectory('/path/to/directory'); |
35 | | - |
36 | | -$coverage = new CodeCoverage( |
37 | | - (new Selector)->forLineCoverage($filter), |
38 | | - $filter |
39 | | -); |
40 | | - |
41 | | -$coverage->start('<name of test>'); |
42 | | - |
43 | | -// ... |
44 | | - |
45 | | -$coverage->stop(); |
46 | | - |
47 | | - |
48 | | -(new HtmlReport)->process($coverage, '/tmp/code-coverage-report'); |
49 | | -``` |
| 1 | +# php增量报告展示 |
| 2 | +具体 |
| 3 | +具体思路 |
| 4 | +具体思路参考 |
| 5 | +https://www.sohu.com/a/326621612_741445 |
0 commit comments