2017 © Pedro Peláez
 

library phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

image

hanken/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  • Thursday, August 24, 2017
  • by hanken
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,096 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 0 Open issues
  • 9 Versions
  • 39 % Grown

The README.md

phpspec-code-coverage

License Latest Stable Version Total Downloads Travis AppVeyor Pre Release, (*1)

[phpspec-code-coverage]0 is a PhpSpec extension that generates Code Coverage reports for PhpSpec tests., (*2)

Generating Code Coverage reports allows you to to analyze which parts of your codebase are tested and how well. However, Code Coverage alone should NOT be used as a single metric defining how good your tests are., (*3)

Note! This is a maintained fork of henrikbjorn/phpspec-code-coverage package with compatible version numbers for stable releases., (*4)

Requirements

Change Log

Please see CHANGELOG.md for information on recent changes., (*5)

Install

Install this package as a development dependency in your project:, (*6)

$ composer require --dev leanphp/phpspec-code-coverage

Enable extension by editing phpspec.yml of your project:, (*7)

``` yaml extensions: LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension: ~, (*8)


This will sufficient to enable Code Coverage generation by using defaults provided by the extension. This extension supports various [configuration options](#Configuration Options). For a fully annotated example configuration file check [Configuration section](#Configuration). ## Usage If you execute `phpspec run` command, you will see code coverage generated in `coverage` directory (in `html` format): $ bin/phpspec run ### Running with phpdbg This extension now supports [phpdbg][4], which results in faster execution when using more recent versions of PHP. Run `phpspec` via [phpdbg][4]: $ phpdbg -qrr phpspec run **Note!** PHP 7+ is required for code generation to work with [phpdbg][4]. ## Configuration You can see fully annotated `phpspec.yml` example file below, which can be used as a starting point to further customize the defaults of the extension. The configuration file below has all of the [Configuration Options](#Configuration Options). ```yaml # phpspec.yml # ... extensions: # ... other extensions ... # leanphp/phpspec-code-coverage LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension: # Specify a list of formats in which code coverage report should be # generated. # Default: [html] format: - text - html #- clover #- php # # Specify output file/directory where code coverage report will be # generated. You can configure different output file/directory per # enabled format. # Default: coverage output: html: coverage #clover: coverage.xml #php: coverage.php # # Should uncovered files be included in the reports? # Default: true #show_uncovered_files: true # # Set lower upper bound for code coverage # Default: 35 #lower_upper_bound: 35 # # Set high lower bound for code coverage # Default: 70 #high_lower_bound: 70 # # Whilelist directories for which code generation should be done # Default: [src, lib] # whitelist: - src - lib # # Whiltelist files for which code generation should be done # Default: empty #whilelist_files: #- app/bootstrap.php #- web/index.php # # Blacklist directories for which code generation should NOT be done #blacklist: #- src/legacy # # Blacklist files for which code generation should NOT be done #blacklist_files: #- lib/bootstrap.php

Configuration Options

  • format (optional) a list of formats in which code coverage should be generated. Can be one or many of: clover, php, text, html (default html) Note: When using clover format option, you have to configure specific output file for the clover format (see below).
  • output (optional) sets an output file/directory where specific code coverage format will be generated. If you configure multiple formats, takes a hash of format:output (e.g. clover:coverage.xml) (default coverage)
  • show_uncovered_files (optional) for including uncovered files in coverage reports (default true)
  • lower_upper_bound (optional) sets lower upper bound for code coverage (default 35).
  • high_lower_bound (optional) sets high lower bound for code coverage (default 70)
  • 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 (default: test, vendor, spec)
  • blacklist_files takes an array of files to blacklist

Authors

Copyright (c) 2017 ek9 dev@ek9.co (https://ek9.co)., (*9)

Copyright (c) 2013-2016 Henrik Bjornskov, for portions of code from henrikbjorn/phpspec-code-coverage project., (*10)

License

Licensed under MIT License., (*11)

The Versions

24/08 2017

dev-master

9999999-dev https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Franco Fallica

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

24/08 2017

v3.2.0

3.2.0.0 https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Franco Fallica

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

31/07 2017

dev-phpspec-4

dev-phpspec-4 https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

31/07 2017

dev-fix-min-deps-build

dev-fix-min-deps-build https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

08/04 2017

dev-badge-update

dev-badge-update https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

21/02 2017

v3.1.0

3.1.0.0 https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

14/02 2017

v3.0.1

3.0.1.0 https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

12/02 2017

v2.1.0

2.1.0.0 https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage

11/02 2017

v1.0.1

1.0.1.0 https://github.com/leanphp/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

  Sources   Download

MIT

The Requires

 

The Development Requires

test code spec tests generate generation phpspec reports report build clover coverage code-coverage