henrikbjorn/phpspec-code-coverage
Deprecated PhpSpec extension that generates code coverage reports (HTML by default, plus clover/php/text) with configurable whitelists/blacklists and output paths. Install via Composer, enable in phpspec.yml, run phpspec (or phpdbg on PHP 7+).
This package is deprecated and archived, but still functional for legacy PhpSpec setups (v2–v3). For Laravel developers, this package is not applicable—Laravel uses PHPUnit, not PhpSpec, and integrates code coverage natively via php artisan test --coverage-html. If you must work with an existing PhpSpec codebase:
composer require --dev henrikbjorn/phpspec-code-coveragephpspec.yml:
extensions:
- PhpSpecCodeCoverage\CodeCoverageExtension
phpspec run — coverage lands in coverage/ (HTML by default).phpspec run -v to see summary in CLI and inspect coverage/index.html.phpdbg: Use phpdbg -qrr phpspec run (PHP 7+) to avoid Xdebug’s slowdown — this extension explicitly supports phpdbg.whitelist/blacklist in phpspec.yml:
extensions:
PhpSpecCodeCoverage\CodeCoverageExtension:
whitelist: [src]
blacklist: [src/Entity/, src/Console/]
format: [html, clover]
output:
html: coverage
clover: coverage.xml
lower_upper_bound: 45
high_lower_bound: 80
phpdbg, despite being listed in require-dev.-v verbosity to see CLI summary; otherwise, only file-based reports appear.phpspec.yml — e.g., output: coverage creates ./coverage/, not config/coverage/.output.clover is missing — always pair format + output explicitly:
format: clover
output: coverage.xml # ❌ fails silently
# vs
output:
clover: coverage.xml # ✅ works
show_uncovered_files: false — hiding uncovered files masks critical gaps; default true is safer for quality control.How can I help you explore Laravel packages today?