Skip to content

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