2017 © Pedro Peláez
 

library phpunit-coverage-check

Check the code coverage using the clover report of phpunit

image

rregeer/phpunit-coverage-check

Check the code coverage using the clover report of phpunit

  • Sunday, July 29, 2018
  • by r.regeer
  • Repository
  • 2 Watchers
  • 5 Stars
  • 43,108 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 6 Versions
  • 48 % Grown

The README.md

Build Status, (*1)

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., (*2)

Installation

The script can be installed using composer. Add this repository as a dependency to the composer.json file., (*3)

composer require --dev rregeer/phpunit-coverage-check

Usage

The script has requires 2 parameters that are mandatory to return the code coverage., (*4)

  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:, (*5)

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

With the --only-percentage enabled, the CLI command will only return the resulting coverage percentage., (*6)

It's also possible to add the coverage report generation to the phpunit.xml.dist add to following lines to the xml file inside the <coverage> tag:, (*7)

<report>
    <clover outputFile="clover.xml" />
</report>

For more information see the phpunit documentation. Information about the configuration file and commandline options., (*8)

The Versions

29/07 2018

dev-master

9999999-dev

Check the code coverage using the clover report of phpunit

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Richard Regeer

phpunit testing php unittest ci code coverage

29/07 2018

0.1.6

0.1.6.0

Check the code coverage using the clover report of phpunit

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Richard Regeer

phpunit testing php unittest ci code coverage

29/03 2018

0.1.5

0.1.5.0

Check the code coverage using the clover report of phpunit

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Richard Regeer

phpunit testing php unittest ci code coverage

13/10 2017

0.1.4

0.1.4.0

Check the code coverage using the clover report of phpunit

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Richard Regeer

phpunit testing php unittest ci code coverage

09/05 2016

0.1.3

0.1.3.0

Check the code coverage using the clover report of phpunit

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Richard Regeer

phpunit testing php unittest ci code coverage

09/05 2016

0.1.0

0.1.0.0

Check the code coverage using the clover report of phpunit

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Richard Regeer

phpunit testing php unittest ci code coverage