GithubHelp home page GithubHelp logo

chiehwen / php-code-coverage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sebastianbergmann/php-code-coverage

0.0 2.0 0.0 1.42 MB

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

License: Other

php-code-coverage's Introduction

PHP_CodeCoverage

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

Requirements

  • PHP_CodeCoverage 1.3 requires PHP 5.4.7 (or later).
  • Xdebug 2.2.1 (or later) is required.

Installation

PHP_CodeCoverage should be installed using the PEAR Installer, the backbone of the PHP Extension and Application Repository that provides a distribution system for PHP packages.

Depending on your OS distribution and/or your PHP environment, you may need to install PEAR or update your existing PEAR installation before you can proceed with the following instructions. sudo pear upgrade PEAR usually suffices to upgrade an existing PEAR installation. The PEAR Manual explains how to perform a fresh installation of PEAR.

The following two commands (which you may have to run as root) are all that is required to install PHP_CodeCoverage using the PEAR Installer:

pear config-set auto_discover 1
pear install pear.phpunit.de/PHP_CodeCoverage

After the installation you can find the PHP_CodeCoverage source files inside your local PEAR directory; the path is usually /usr/lib/php/PHP/CodeCoverage.

Using the PHP_CodeCoverage API

<?php
require 'PHP/CodeCoverage/Autoload.php';

$coverage = new PHP_CodeCoverage;
$coverage->start('<name of test>');

// ...

$coverage->stop();

$writer = new PHP_CodeCoverage_Report_Clover;
$writer->process($coverage, '/tmp/clover.xml');

$writer = new PHP_CodeCoverage_Report_HTML;
$writer->process($coverage, '/tmp/code-coverage-report');

php-code-coverage's People

Contributors

sebastianbergmann avatar edorian avatar fabpot avatar slamdunk avatar pborreli avatar pfeigl avatar christeredvartsen avatar marcgear avatar mbeccati avatar mattleff avatar thomasweinert avatar tombevers avatar dharkness avatar hakre avatar jakoch avatar

Watchers

Chuck Yang avatar James Cloos 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.