2017 © Pedro Peláez
 

library peridot-code-coverage-reporters

Code coverage reporters for Peridot PHP.

image

peridot-php/peridot-code-coverage-reporters

Code coverage reporters for Peridot PHP.

  • Monday, September 18, 2017
  • by austinsmorris
  • Repository
  • 3 Watchers
  • 1 Stars
  • 32,580 Installations
  • PHP
  • 25 Dependents
  • 1 Suggesters
  • 3 Forks
  • 1 Open issues
  • 9 Versions
  • 9 % Grown

The README.md

Peridot Code Coverage Reporters

Packagist Version Build Status Scrutinizer Code Quality Codecov Coverage Gitter Chat, (*1)

Installation

Add this package as a dependency:, (*2)

composer require --dev peridot-php/peridot-code-coverage-reporters

Then register the reporters in your peridot.php configuration:, (*3)

use Evenement\EventEmitterInterface;
use Peridot\Reporter\CodeCoverage\CodeCoverageReporter;
use Peridot\Reporter\CodeCoverageReporters;

return function (EventEmitterInterface $emitter) {
    $coverage = new CodeCoverageReporters($emitter);
    $coverage->register();

    $emitter->on('code-coverage.start', function (CodeCoverageReporter $reporter) {
        $reporter->addDirectoryToWhitelist(__DIR__ . '/src');
    });
};

Usage

This package provides several Peridot reporters that can be used via the --reporter option:, (*4)

  • html-code-coverage
  • text-code-coverage
  • clover-code-coverage
  • xml-code-coverage
  • crap4j-code-coverage
  • php-code-coverage

These reporters are all driven by php-code-coverage, which requires the use of either the phpdbg executable, or the xdebug PHP extension in order to produce coverage reports., (*5)

With phpdbg

Where available, phpdbg is generally recommended for faster coverage reporting. Most system-level package management tools should be able to install a version of phpdbg with minimal hassle. Under Homebrew, for example, phpdbg can be installed like so:, (*6)

brew tap homebrew/homebrew-php && brew install php71 --with-phpdbg

Once installed, phpdbg -qrr can be used in place of php when executing scripts, including the peridot binary, allowing code coverage to be generated:, (*7)

phpdbr -qrr vendor/bin/peridot --reporter spec --reporter html-code-coverage

The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed., (*8)

With xdebug

Use of xdebug is no longer recommended, because of the significantly worse performance compared to phpdbg. If phpdbg is not an option, simply make sure the xdebug extension is enabled when running peridot:, (*9)

vendor/bin/peridot --reporter spec --reporter html-code-coverage

The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed., (*10)

The Versions

18/09 2017

dev-master

9999999-dev

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

18/09 2017

dev-phpcc-4-5

dev-phpcc-4-5

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

18/09 2017

3.0.0

3.0.0.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

06/01 2017

2.0.2

2.0.2.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

13/03 2016

2.0.1

2.0.1.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

10/03 2016

2.0.0

2.0.0.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

30/10 2014

1.0.2

1.0.2.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

30/10 2014

1.0.1

1.0.1.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris

29/10 2014

1.0.0

1.0.0.0

Code coverage reporters for Peridot PHP.

  Sources   Download

MIT

The Requires

 

by Austin Morris