babeuloula/phpunit-coverage-checker

PhpUnit coverage checker, fail if coverage goes below a threshold

v1.0.1 2021-07-12 12:41 UTC

This package is auto-updated.

Last update: 2024-05-12 20:18:38 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.