g4/code-coverage

Installs: 46 871

Dependents: 13

Suggesters: 0

Security: 0

Stars: 1

Watchers: 9

Forks: 3

Open Issues: 0

Type:project

2.0.2 2024-02-21 08:54 UTC

This package is auto-updated.

Last update: 2024-12-21 10:58:35 UTC


README

code-coverage - php command line tool for analysing phpunit xml code coverage report

Install

Via Composer

composer require g4/code-coverage

Usage

Before running code-coverage, run phpunit with --coverage-clover option to generate code-coverage xml file

./vendor/bin/phpunit --coverage-clover=path/to/code-coverage.xml
usage: code-coverage [<options>]

Analyze phpunit coverage report.

OPTIONS
  --file, -f         Path to phpunit's code coverage xml report
  --help, -?         Display this help.
  --percentage, -p   Minimum coverage percentage to be considered "highly"
                     covered.

e.g.
./vendor/bin/code-coverage -p 90 -f path/to/code-coverage.xml

output:
 Required:     90.00%
   Methods:    91.43%
   Statements: 95.58%
   Elements:   94.59%

Development

Install dependencies

$ composer install

Run tests

$ composer unit-test

License

(The MIT License) see LICENSE file for details...