Skip to content

Commit

Permalink
Enhance how the configuration is of code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mosbth committed Apr 23, 2024
1 parent 35f25f2 commit d05962b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions example/phpunit-symfony/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ App\Dice\Dice

We can generate code coverage as HTML. To do so we update the configuration file `phpunit.xml.dist` with a report instruction on the code coverage.

```xml
<report>
<clover outputFile="docs/coverage.clover"/>
<html outputDirectory="docs/coverage" lowUpperBound="35" highLowerBound="70"/>
</report>
```

You should place that section within the `<coverage>` and `</coverage>`. You can see a complete configuration filen in [`phpunit.xml.dist`](phpunit.xml.dist).

```xml
Expand All @@ -127,6 +134,12 @@ You should place that section within the `<coverage>` and `</coverage>`. You can
</coverage>
```

You can now execute the test suite and generate the code coverage report.

```
XDEBUG_MODE=coverage bin/phpunit
```

When the test suite is executed and the code coverage reports are generated it might look like this in the output.

```
Expand Down

0 comments on commit d05962b

Please sign in to comment.