PHPackages                             beporter/coverage-ensure - 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. beporter/coverage-ensure

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

beporter/coverage-ensure
========================

PHP CLI script that reads clover.xml coverage reports and returns non-zero when percent coverage is below specified threshold. Intended for use with automated test/build tools like Travis CI, Circle CI, GitHub Actions and Jenkins.

1.1.1(2mo ago)23861MITPHPPHP &gt;=7.0 || &gt;=8.0

Since Jul 22Pushed 3w agoCompare

[ Source](https://github.com/beporter/php-coverage-ensure)[ Packagist](https://packagist.org/packages/beporter/coverage-ensure)[ Docs](https://github.com/beporter/php-coverage-ensure)[ RSS](/packages/beporter-coverage-ensure/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (3)DependenciesVersions (4)Used By (1)

php-coverage-ensure
===================

[](#php-coverage-ensure)

A composer package that provides a PHP CLI script able to clover.xml coverage reports and return non-zero when percent coverage is below specified threshold. Intended for use with automated test/build tools like Travis CI, Circle CI and Jenkins.

Requirements
------------

[](#requirements)

- PHP 7.0+
    - php-xdebug extension
    - phpunit, for generating code coverage reports

Installation
------------

[](#installation)

```
# In your project:
$ composer require --dev beporter/php-coverage-ensure
```

Usage
-----

[](#usage)

Before calling the script, you must produce a clover coverage report for your project. This can be done with PHPUnit.

```
$ vendor/bin/phpunit --coverage-clover tmp/clover.xml
```

Then call the script providing the path to a clover XML coverage report file and an optional minimum acceptable percentage.

```
$ vendor/bin/coverage-ensure tmp/clover.xml 80
```

### Advanced Usage

[](#advanced-usage)

If you want PHPUnit to *always* generate a clover report, you can also add the following block to your `phpunit.xml` or `phpunit.xml.dist` file:

```

```

This package also includes a helper script that can determine the location of your clover report file by reading your phpunit config file:

```
$ vendor/bin/coverage-ensure `vendor/bin/clover-path-from-phpunit` 80
```

Contributing
------------

[](#contributing)

### Code of Conduct

[](#code-of-conduct)

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. [Translations are available](https://www.contributor-covenant.org/translations).

### Reporting Issues

[](#reporting-issues)

Please use [GitHub Isuses](https://github.com/beporter/php-coverage-ensure/issues) for listing any known defects or issues.

### Development

[](#development)

Please fork this repository, create a new topic branch, and submit a [pull request](https://github.com/beporter/php-coverage-ensure/issues) for your work.

Credits
-------

[](#credits)

This work was originally done as a part of [loadsys/cakephp-shell-scripts](https://github.com/loadsys/CakePHP-Shell-Scripts) and broken out here for greater portability/reuse.

License
-------

[](#license)

[MIT](LICENSE.md)

Copyright
---------

[](#copyright)

Copyright © 2018 Brian Porter

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance92

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~2882 days

Total

2

Last Release

63d ago

PHP version history (2 changes)1.1.0PHP ^7.0.0

1.1.1PHP &gt;=7.0 || &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/637270?v=4)[Brian Porter](/maintainers/beporter)[@beporter](https://github.com/beporter)

---

Top Contributors

[![beporter](https://avatars.githubusercontent.com/u/637270?v=4)](https://github.com/beporter "beporter (8 commits)")

---

Tags

composer-packagescoveragehacktoberfestphpphpunitphpunitcicode coverage

### Embed Badge

![Health badge](/badges/beporter-coverage-ensure/health.svg)

```
[![Health](https://phpackages.com/badges/beporter-coverage-ensure/health.svg)](https://phpackages.com/packages/beporter-coverage-ensure)
```

###  Alternatives

[nette/tester

Nette Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏

4867.6M1.7k](/packages/nette-tester)[rregeer/phpunit-coverage-check

Check the code coverage using the clover report of phpunit

606.6M228](/packages/rregeer-phpunit-coverage-check)[shipmonk/coverage-guard

Enforce code coverage in your CI. Not by percentage, but target core methods. No more untested Facades, Controllers, or Repositories. Allows you to start enforcing coverage for new code only!

5656.7k14](/packages/shipmonk-coverage-guard)[hot/phpunit-runner

The lib allows to watch phpunit tests

2867.5k4](/packages/hot-phpunit-runner)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

17172.4k60](/packages/robiningelbrecht-phpunit-coverage-tools)[shipmonk/phpunit-parallel-job-balancer

Balances PHPUnit test execution across parallel jobs based on JUnit XML timing data

103.7k](/packages/shipmonk-phpunit-parallel-job-balancer)

PHPackages © 2026

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