Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpspec Code Coverage Laravel Package

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+).

View on GitHub
Deep Wiki
Context7

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.

Install with Composer:

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

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)

For faster execution, run phpspec with phpdbg 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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport