PHPackages                             matthiasnoback/behat-remote-code-coverage-extension - 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. matthiasnoback/behat-remote-code-coverage-extension

ActiveLibrary[Testing &amp; Quality](/categories/testing)

matthiasnoback/behat-remote-code-coverage-extension
===================================================

v0.4.1(4y ago)14350.5k↓22.2%7MITPHPPHP &gt;=7.0

Since Feb 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/matthiasnoback/behat-remote-code-coverage-extension)[ Packagist](https://packagist.org/packages/matthiasnoback/behat-remote-code-coverage-extension)[ RSS](/packages/matthiasnoback-behat-remote-code-coverage-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (8)Used By (0)

Behat remote code coverage extension
====================================

[](#behat-remote-code-coverage-extension)

This extension can be used to collect code coverage data from the web server that's called by Mink while running Behat.

To use this extension, enable it under `extensions` and for every suite that needs remote code coverage collection, set `remote_coverage_enabled` to `true`.

```
default:
    extensions:
        BehatRemoteCodeCoverage\RemoteCodeCoverageExtension:
            target_directory: '%paths.base%/var/coverage'
    suites:
        default:
            remote_coverage_enabled: true
```

Now modify the front controller of your web application to look like this:

```
use LiveCodeCoverage\RemoteCodeCoverage;

$shutDownCodeCoverage = RemoteCodeCoverage::bootstrap(
    (bool)getenv('CODE_COVERAGE_ENABLED'),
    sys_get_temp_dir(),
    __DIR__ . '/../phpunit.xml.dist'
);

// Run your web application now...

// This will save and store collected coverage data:
$shutDownCodeCoverage();
```

Make sure to modify the call to `RemoteCodeCoverage::bootstrap()` if needed:

1. Provide your own logic to determine if code coverage should be enabled in the first place (this example uses an environment variable for that). This is important for security reasons. It helps you make sure that the production server won't expose any collected coverage data.
2. Provide your own directory for storing the coverage data files (`.cov`).
3. Provide the path to your own `phpunit.xml(.dist)` file. This file is only used for its [code coverage filter configuration](https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.whitelisting-files).

After a test run, the extension makes a special call (`/?code_coverage_export=true&...`) to the web application. The response to this call contains the serialized code coverage data. It will be stored as a file in `target_directory`, named after the test suite itself, e.g. `default.cov`.

You can use these `.cov` files to generate nice reports, using [`phpcov`](https://github.com/sebastianbergmann/phpcov).

You could even configure PHPUnit to generate a `.cov` file in the same directory, so you can combine coverage data from PHPUnit and Behat in one report.

To (also) generate (local) code coverage during a Behat test run, use the [`LocalCodeCoverageExtension`](https://github.com/matthiasnoback/behat-local-code-coverage-extension/).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~226 days

Recently: every ~261 days

Total

7

Last Release

1654d ago

PHP version history (2 changes)v0.1.0PHP ^7.0

v0.4.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1193078?v=4)[Matthias Noback](/maintainers/matthiasnoback)[@matthiasnoback](https://github.com/matthiasnoback)

---

Top Contributors

[![matthiasnoback](https://avatars.githubusercontent.com/u/1193078?v=4)](https://github.com/matthiasnoback "matthiasnoback (9 commits)")[![adrienbrault](https://avatars.githubusercontent.com/u/611271?v=4)](https://github.com/adrienbrault "adrienbrault (2 commits)")[![ahocquard](https://avatars.githubusercontent.com/u/1942439?v=4)](https://github.com/ahocquard "ahocquard (1 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (1 commits)")[![magikid](https://avatars.githubusercontent.com/u/115515?v=4)](https://github.com/magikid "magikid (1 commits)")[![webdevel](https://avatars.githubusercontent.com/u/1288852?v=4)](https://github.com/webdevel "webdevel (1 commits)")

### Embed Badge

![Health badge](/badges/matthiasnoback-behat-remote-code-coverage-extension/health.svg)

```
[![Health](https://phpackages.com/badges/matthiasnoback-behat-remote-code-coverage-extension/health.svg)](https://phpackages.com/packages/matthiasnoback-behat-remote-code-coverage-extension)
```

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.1M147](/packages/drupal-drupal-extension)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2286.0M445](/packages/friends-of-behat-variadic-extension)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)[matthiasnoback/behat-local-code-coverage-extension

26486.8k2](/packages/matthiasnoback-behat-local-code-coverage-extension)[drevops/behat-steps

Collection of steps for Behat

25381.7k3](/packages/drevops-behat-steps)[devinci/devinci-behat-extension

Provides extra behat goodies.

17593.9k](/packages/devinci-devinci-behat-extension)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
