Skip to content

Commit 9ffb93c

Browse files
committed
Add README.md
1 parent 1bf7ec2 commit 9ffb93c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PHPUnit code coverage baseline
2+
==============================
3+
4+
It is a base implementation of baseline support for Clover reposts of PHPUnit.
5+
6+
Installation
7+
------------
8+
9+
`composer require --dev aeliot-tm/phpunit-codecoverage-baseline`
10+
11+
Usage
12+
-----
13+
14+
1. Add baseline file to the project. See [example](docs/phpunit.clover.baseline.json).
15+
2. Run your tests with [configured](https://phpunit.readthedocs.io/en/9.5/configuration.html#the-report-element)
16+
code coverage Clover report or with [command line option](https://phpunit.readthedocs.io/en/9.5/textui.html?highlight=clover#command-line-options).
17+
```shell
18+
phpunit --coverage-clover 'build/coverage/clover.xml' tests/
19+
```
20+
3. Call [script](bin/phpunit_clover_compare).
21+
```shell
22+
vendor/bin/phpunit_clover_compare
23+
```
24+
It accepts options:
25+
26+
| Full name | Short name | Description | Default value |
27+
|--------------|------------|---------------------------|--------------------------------|
28+
| `--baseline` | `-b` | Path to the baseline | `phpunit.clover.baseline.json` |
29+
| `--clover` | `-c` | Path to the Clover report | `build/coverage/clover.xml` |

docs/phpunit.clover.baseline.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"methods": 160,
3+
"coveredmethods": 159,
4+
"conditionals": 0,
5+
"coveredconditionals": 0,
6+
"statements": 296,
7+
"coveredstatements": 295,
8+
"elements": 456,
9+
"coveredelements": 454
10+
}

0 commit comments

Comments
 (0)