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 and Jenkins.

1.1.0(7y ago)2261MITPHPPHP ^7.0.0

Since Jul 22Pushed 4y 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 master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2853d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7039a57d1442d7172ce2eeef936df3a8c80f9f01b9612311e02c8e1304f3fe75?d=identicon)[beporter](/maintainers/beporter)

---

Top Contributors

[![beporter](https://avatars.githubusercontent.com/u/637270?v=4)](https://github.com/beporter "beporter (6 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. 🍏🍏🍎🍏

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

Check the code coverage using the clover report of phpunit

606.1M179](/packages/rregeer-phpunit-coverage-check)[hot/phpunit-runner

The lib allows to watch phpunit tests

3066.9k4](/packages/hot-phpunit-runner)[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!

5318.5k4](/packages/shipmonk-coverage-guard)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k34](/packages/robiningelbrecht-phpunit-coverage-tools)

PHPackages © 2026

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