PHPackages                             henrikbjorn/phpspec-code-coverage - 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. henrikbjorn/phpspec-code-coverage

AbandonedArchivedLibrary

henrikbjorn/phpspec-code-coverage
=================================

Integrates CodeCoverage with PhpSpec

3.0.1(9y ago)100799.3k—1.7%2820MITPHPPHP ^5.5|^5.6|^7.0

Since May 26Pushed 8y ago3 watchersCompare

[ Source](https://github.com/henrikbjorn/PhpSpecCodeCoverageExtension)[ Packagist](https://packagist.org/packages/henrikbjorn/phpspec-code-coverage)[ RSS](/packages/henrikbjorn-phpspec-code-coverage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (14)Used By (20)

[PhpSpec](http://phpspec.net) Code Coverage
===========================================

[](#phpspec-code-coverage)

**DEPRECATED**: CodeCoverage should not be used with spec testing in order to see how good your tests are. For that reason, and because I don't use it myself, this library is deprecated and will not receive any updates etc. For a maintained fork, you can check [leanphp/phpspec-code-coverage](https://github.com/leanphp/phpspec-code-coverage).

Install with [Composer](http://getcomposer.org):

```
composer require --dev henrikbjorn/phpspec-code-coverage
```

Enable it in your `phpspec.yml` file:

```
extensions:
    - PhpSpecCodeCoverage\CodeCoverageExtension
```

Now run your specs with the normal `phpspec run` and voilà your code coverage will be available in `coverage`.

Configuration Options
---------------------

[](#configuration-options)

It is possible to control a bit out how the code coverage is done through `phpspec.yml`. This is done by adding a hash of options to the extension key.

- `whitelist` takes an array of directories to whitelist (default: `lib`, `src`).
- `whitelist_files` takes an array of files to whitelist (default: none).
- `blacklist` takes an array of directories to blacklist
- `blacklist_files` takes an array of files to blacklist
- `format` (optional) could be one or many of: `clover`, `php`, `text`, `html` (default `html`)
- `output` takes a location relative to the place you are running `phpspec run` (default: `coverage`). If you configure multiple formats, takes a hash of format:output e.g.

```
extensions:
  PhpSpecCodeCoverage\CodeCoverageExtension:
    format:
      - html
      - clover
    output:
      html: coverage
      clover: coverage.xml
```

- `show_uncovered_files` for including uncovered files in coverage reports (default `true`)
- `lower_upper_bound` for coverage (default `35`)
- `high_lower_bound` for coverage (default `70`)

**Note**: If the clover format option requires you to also set an output location!

Running with phpdbg (PHP 7.x and up)
------------------------------------

[](#running-with-phpdbg-php-7x-and-up)

For faster execution, run phpspec with [phpdbg](http://phpdbg.com) instead of xdebug:

```
phpdbg -qrr phpspec run
```

**Note**: The code coverage extension only works with phpdbg if you're using PHP 7. In PHP 5.6, phpdbg is missing the phpdbg\_start\_oplog function which is required to generate code coverage.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community45

Growing community involvement

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% 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 ~72 days

Recently: every ~45 days

Total

12

Last Release

3577d ago

Major Versions

0.2.0 → 1.0.02014-12-11

1.x-dev → 2.0.02015-11-04

2.x-dev → 3.0.02016-07-31

PHP version history (6 changes)0.1.0PHP &gt;=5.3.3

2.0.0PHP ~5.6

2.0.1PHP ^5.6|^7.0

2.0.2PHP ^5.6|^7.0|^5.5

2.1.0PHP ^5.3.3|^5.4|^5.5|^5.6|^7.0

3.0.0PHP ^5.5|^5.6|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/88caaddb9c765141dba5816fbb2f8a5ed8e2125338b97e30261e19bb88cdaa23?d=identicon)[henrikbjorn](/maintainers/henrikbjorn)

---

Top Contributors

[![henrikbjorn](https://avatars.githubusercontent.com/u/19725?v=4)](https://github.com/henrikbjorn "henrikbjorn (46 commits)")[![kwisatz](https://avatars.githubusercontent.com/u/237949?v=4)](https://github.com/kwisatz "kwisatz (7 commits)")[![svemir](https://avatars.githubusercontent.com/u/154453?v=4)](https://github.com/svemir "svemir (4 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (3 commits)")[![lookitsatravis](https://avatars.githubusercontent.com/u/606978?v=4)](https://github.com/lookitsatravis "lookitsatravis (3 commits)")[![DavidGarciaCat](https://avatars.githubusercontent.com/u/7809429?v=4)](https://github.com/DavidGarciaCat "DavidGarciaCat (2 commits)")[![exu](https://avatars.githubusercontent.com/u/30776?v=4)](https://github.com/exu "exu (2 commits)")[![fesor](https://avatars.githubusercontent.com/u/172247?v=4)](https://github.com/fesor "fesor (2 commits)")[![michaldudek](https://avatars.githubusercontent.com/u/802141?v=4)](https://github.com/michaldudek "michaldudek (2 commits)")[![milan](https://avatars.githubusercontent.com/u/3963?v=4)](https://github.com/milan "milan (2 commits)")[![rnijveld](https://avatars.githubusercontent.com/u/193783?v=4)](https://github.com/rnijveld "rnijveld (2 commits)")[![firstrow](https://avatars.githubusercontent.com/u/66944?v=4)](https://github.com/firstrow "firstrow (1 commits)")[![ek9](https://avatars.githubusercontent.com/u/17393048?v=4)](https://github.com/ek9 "ek9 (1 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")[![digitalkaoz](https://avatars.githubusercontent.com/u/293591?v=4)](https://github.com/digitalkaoz "digitalkaoz (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![piorek](https://avatars.githubusercontent.com/u/743617?v=4)](https://github.com/piorek "piorek (1 commits)")[![renanivo](https://avatars.githubusercontent.com/u/136425?v=4)](https://github.com/renanivo "renanivo (1 commits)")[![wimvds](https://avatars.githubusercontent.com/u/777114?v=4)](https://github.com/wimvds "wimvds (1 commits)")[![roukmoute](https://avatars.githubusercontent.com/u/2140469?v=4)](https://github.com/roukmoute "roukmoute (1 commits)")

### Embed Badge

![Health badge](/badges/henrikbjorn-phpspec-code-coverage/health.svg)

```
[![Health](https://phpackages.com/badges/henrikbjorn-phpspec-code-coverage/health.svg)](https://phpackages.com/packages/henrikbjorn-phpspec-code-coverage)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[friends-of-phpspec/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

202.6M125](/packages/friends-of-phpspec-phpspec-code-coverage)[innmind/black-box

Test library

44178.7k93](/packages/innmind-black-box)[rmiller/behat-spec

Behat and PhpSpec integration

5321.7k8](/packages/rmiller-behat-spec)

PHPackages © 2026

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