babeuloula / phpunit-coverage-checker
PhpUnit coverage checker, fail if coverage goes below a threshold
Package info
github.com/babeuloula/phpunit-coverage-checker
pkg:composer/babeuloula/phpunit-coverage-checker
v1.0.1
2021-07-12 12:41 UTC
Requires
- php: >=7.1
- ext-simplexml: *
This package is auto-updated.
Last update: 2026-03-13 00:12:10 UTC
README
This script will read the XML coverage result and calculates the coverage score. Based on the given threshold the script will exit(0) if the coverage is higher than the threshold or exit(1) if the coverage is lower than the threshold.
Installation
composer require --dev babeuloula/phpunit-coverage-checker
Usage
vendor/bin/coverage-checker <path/to/coverage/index.xml> <threshold>
Example:
./vendor/bin/phpunit --coverage-xml ./coverage vendor/bin/coverage-checker coverage/xml/index.xml 80
Thanks
Thanks to richardregeer and cylab.be.