PHPackages                             codeception/c3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. codeception/c3

ActiveComposer-plugin[Testing &amp; Quality](/categories/testing)

codeception/c3
==============

CodeCoverage collector for Codeception

2.9.0(2y ago)745.3M↓12.4%47[7 issues](https://github.com/Codeception/c3/issues)[3 PRs](https://github.com/Codeception/c3/pulls)20MITPHPPHP &gt;=5.5.0

Since Oct 3Pushed 2y ago10 watchersCompare

[ Source](https://github.com/Codeception/c3)[ Packagist](https://packagist.org/packages/codeception/c3)[ Docs](http://codeception.com/)[ RSS](/packages/codeception-c3/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (32)Used By (20)

**[Issues](https://github.com/Codeception/Codeception/issues)** | **[Usage Guide](https://codeception.com/docs/11-Codecoverage)**

Remote CodeCoverage for Codeception [![Build Status](https://camo.githubusercontent.com/6095a69d54d4eac145fd48a304a0b15f281a8e827d2e393b1b269c7f913d2d00/68747470733a2f2f7472617669732d63692e6f72672f436f646563657074696f6e2f63332e7376673f6272616e63683d322e30)](https://travis-ci.org/Codeception/c3)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#remote-codecoverage-for-codeception-)

This file `c3.php` should be included into the application you are testing in the very first line. It will start remote code coverage collection. Coverage data will be stored to disk and retrieved by `codeception` when tests from the suite are finished. This file won't affect your application in any way. It is executed **only** when a special header `X-Codeception-CodeCoverage` is sent. Alternatively, if you use Selenium, special cookie `CODECEPTION_CODECOVERAGE` is used. In any other case your application run as usually with no overheads.

### Local Code Coverage

[](#local-code-coverage)

If you don't run tests on remote server but use a webserver (Apache, Nginx, PhpWebserver) you need `c3.php` installed just the same way. In this case coverage result will be merged with local code coverage.

### Installation

[](#installation)

File `c3.php` should be put in project root, into the same directory where `codeception.yml` config is located. Also, make sure Codeception is available on remote server either in phar/pear/composer packages.

#### Via Composer

[](#via-composer)

Add to `composer.json`:

```
"require-dev": {
    "codeception/codeception": "3.*",
    "codeception/c3": "2.*"
}

```

C3 installer will copy `c3.php` to the project root.

#### Manually

[](#manually)

```
wget https://raw.github.com/Codeception/c3/2.0/c3.php

```

### Setup

[](#setup)

Now you should include c3.php in your front script, like `index.php`.

Example file: `web/index.php`:

```
