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.8k↓66.7%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 yesterday

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

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

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

1708d 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.7M173](/packages/drupal-drupal-extension)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2276.4M507](/packages/friends-of-behat-variadic-extension)[drevops/behat-steps

Collection of steps for Behat

27431.3k4](/packages/drevops-behat-steps)[imbo/behat-api-extension

API extension for Behat

1092.6M9](/packages/imbo-behat-api-extension)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

623.9M54](/packages/dvdoug-behat-code-coverage)

PHPackages © 2026

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