Git Product home page Git Product logo

php-code-coverage's Introduction

Latest Stable Version Build Status

PHP_CodeCoverage

PHP_CodeCoverage is a library that provides collection, processing, and rendering functionality for PHP code coverage information.

Requirements

PHP 5.6 is required but using the latest version of PHP is highly recommended.

PHP 5

Xdebug is the only source of raw code coverage data supported for PHP 5. Version 2.2.1 of Xdebug is required but using the latest version is highly recommended.

PHP 7

Version 2.4.0 (or later) of Xdebug as well as phpdbg are supported sources of raw code coverage data for PHP 7.

HHVM

A version of HHVM that implements the Xdebug API for code coverage (xdebug_*_code_coverage()) is required.

Installation

To add PHP_CodeCoverage as a local, per-project dependency to your project, simply add a dependency on phpunit/php-code-coverage to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on PHP_CodeCoverage 4.0:

{
    "require": {
        "phpunit/php-code-coverage": "4.0.*"
    }
}

Using the PHP_CodeCoverage API

<?php
$coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage();
$coverage->start('<name of test>');

// ...

$coverage->stop();

$writer = \SebastianBergmann\CodeCoverage\Report\Clover();
$writer->process($coverage, '/tmp/clover.xml');

$writer = new \SebastianBergmann\CodeCoverage\Report\Html\Facade();
$writer->process($coverage, '/tmp/code-coverage-report');

php-code-coverage's People

Contributors

sebastianbergmann avatar edorian avatar whatthejeff avatar grahamcampbell avatar maks3w avatar theseer avatar staabm avatar kelunik avatar alexshadow007 avatar tombevers avatar fabpot avatar jeroendedauw avatar bwoebi avatar cbandy avatar crishoj avatar ashnazg avatar slamdunk avatar hpbuniat avatar foozee avatar pborreli avatar pfeigl avatar engerim avatar brettmc avatar christeredvartsen avatar bizmate avatar gelolabs avatar fpietka avatar glenjamin avatar henriquemoody avatar jaydiablo avatar

Watchers

James Cloos avatar Gerhard Alfanz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.