Provide code coverage extension during phpspec run
- PHP: >=7.0
- Behat: >=3.0
- PHP Code Coverage: >=5.3
$ composer require doyo/phpspec-code-coverage
After installing this extension, you can collect code coverage by using this command:
$ ./vendor/bin/phpspec run --coverage
The reports will be generated in target directory as you defined in configuration.
# phpspec.yaml.dist
extensions:
Doyo\PhpSpec\CodeCoverage\Extension:
filters:
whitelist:
- src
blacklist:
- path/to/blacklist/dir
reports:
php: build/cov/phpspec.cov
html: build/phpspec