PhpSpec: Code coverage plugin

Dimitrios Savvopoulos edited this page May 1, 2014 · 3 revisions

Installation

Composer.json

"henrikbjorn/phpspec-code-coverage" : "1.*@dev"

Html format

Config

Create the file spec/phpspec-cov-html.yml and add the following content. Here we tell PhpSpec to save the coverage files under the directory build/coverage.

extensions:
    - PhpSpec\Extension\CodeCoverageExtension

code_coverage:
    output: build/coverage
    format: html

Run

bin/phpspec run --config=spec/phpspec-cov-html.yml

Clover format

Config

Create the file phpspec/phpspec-cov-xml.yml and add the following content. Here we tell phpspec to save the coverage xml file under build/coverage.xml.

extensions:
    - PhpSpec\Extension\CodeCoverageExtension

code_coverage:
    output: build/coverage.xml
    format: clover

Run

bin/phpspec run --config=spec/phpspec-cov-xml.yml

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.