PHPackages                             gotrendier/phpunit-coverage-check - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. gotrendier/phpunit-coverage-check

ActiveLibrary[Testing &amp; Quality](/categories/testing)

gotrendier/phpunit-coverage-check
=================================

Check the code coverage using the clover report of phpunit

1.0.0(3y ago)06.8k—3.4%MITPHPPHP &gt;=7.0.0

Since Jun 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/gotrendier/phpunit-coverage-check)[ Packagist](https://packagist.org/packages/gotrendier/phpunit-coverage-check)[ RSS](/packages/gotrendier-phpunit-coverage-check/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/52866c2067c04792858d0b7d4600797f0c32dfbb7e97f541688f2014d860cae4/68747470733a2f2f7472617669732d63692e6f72672f726963686172647265676565722f706870756e69742d636f7665726167652d636865636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/richardregeer/phpunit-coverage-check)

phpunit-coverage-check
======================

[](#phpunit-coverage-check)

This php script will read the clover xml report from phpunit and calculates the coverage score. Based on the given threshold the script will exit ok of the coverage is higher then the threshold or exit with code 1 if the coverage is lower then the threshold. This script can be used in your continuous deployment environment or for example added to a pre-commit hook.

Installation
============

[](#installation)

The script can be installed using composer. Add this repository as a dependency to the composer.json file.

```
composer require --dev gotrendier/phpunit-coverage-check
```

Usage
=====

[](#usage)

The script has requires 2 parameters that are mandatory to return the code coverage.

1. The location of the clover xml file, that's generated by phpunit.
2. The coverage threshold that is acceptable. Min = 1, Max = 100

Generate the `clover.xml` file by using phpunit and run the coverage check script: Run the script:

```
vendor/bin/phpunit --coverage-clover clover.xml
vendor/bin/coverage-check clover.xml 80
vendor/bin/coverage-check clover.xml 80 app
vendor/bin/coverage-check clover.xml 80 --only-percentage
vendor/bin/coverage-check clover.xml 80 --only-percentage app
```

With the `--only-percentage` enabled, the CLI command will only return the resulting coverage percentage.

By default, `chictrend` folder will be measured. If you pass a folder like `app` after de percentage argument or`--only-percentage` argument that folder will be measured.

It's also possible to add the coverage report generation to the phpunit.xml.dist add to following line to the xml file:

```

```

For more information see the [phpunit documentation](https://phpunit.de/manual/5.3/en/index.html). Information about the [configuration file](https://phpunit.de/manual/5.3/en/appendixes.configuration.html#appendixes.configuration) and [commandline options](https://phpunit.de/manual/current/en/textui.html#textui.clioptions).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1117d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/75218105?v=4)[gotrendier](/maintainers/gotrendier)[@gotrendier](https://github.com/gotrendier)

### Embed Badge

![Health badge](/badges/gotrendier-phpunit-coverage-check/health.svg)

```
[![Health](https://phpackages.com/badges/gotrendier-phpunit-coverage-check/health.svg)](https://phpackages.com/packages/gotrendier-phpunit-coverage-check)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M360](/packages/dms-phpunit-arraysubset-asserts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
