2017 © Pedro Peláez
 

library behat-code-coverage

Generate Code Coverage reports for Behat tests

image

leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

  • Thursday, May 10, 2018
  • by ek9
  • Repository
  • 5 Watchers
  • 23 Stars
  • 17,574 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 14 Forks
  • 4 Open issues
  • 20 Versions
  • 53 % Grown

The README.md

behat-code-coverage

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

[behat-code-coverage]0 is a Behat extension that generates Code Coverage reports for Behat 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 vipsoft/code-coverage-extension, including codebase for vipsoft/code-coverage-common 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/behat-code-coverage

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

``` yaml default: extensions: LeanPHP\Behat\CodeCoverage\Extension: drivers: - local filter: whitelist: include: directories: 'src': ~ report: format: html options: target: build/behat-coverage, (*8)


This will sufficient to enable Code Coverage generation in `html` format in `build/behat-coverage` directory. This extension supports various [Configuration options](#configuration-options). For a fully annotated example configuration file check [Configuration section](#configuration). ## Usage If you execute `bin/behat` command, you will see code coverage generated in `target` (i.e. `build/behat-coverage`) directory (in `html` format): $ bin/behat ### Running with phpdbg This extension now supports [phpdbg][6], which results in faster execution when using more recent versions of PHP. Run `phpspec` via [phpdbg][6]: $ phpdbg -qrr bin/behat run ## Configuration You can see fully annotated `behat.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 # behat.yml # ... default: extensions: LeanPHP\Behat\CodeCoverage\Extension: # http auth (optional) auth: ~ # select which driver to use when gatherig coverage data drivers: - local # local Xdebug driver # filter options filter: forceCoversAnnotation: false mapTestClassNameToCoveredClassName: false whitelist: addUncoveredFilesFromWhitelist: true processUncoveredFilesFromWhitelist: false include: directories: 'src': ~ 'tests': suffix: '.php' # files: # - script1.php # - script2.php # exclude: # directories: # 'vendor': ~ # 'path/to/dir': # 'suffix': '.php' # 'prefix': 'Test' # files: # - tests/bootstrap.php # report configuration report: # report format (html, clover, php, text) format: html # report options options: target: build/behat-coverage/html

Configuration Options

  • auth - HTTP authentication options (optional).
  • create (method / path) - override options for create method:
    • method - specify a method (default: POST)
    • path - specify path (default: /)
  • read (method / path) - override options (method and path) for read method.
    • method - specify a method (default: GET)
    • path - specify path (default: /)
  • delete (method / path) - override options (method and path) for delete method.
    • method - specify a method (default: DELETE)
    • path - specify path (default: /)
  • drivers - a list of drivers for gathering code coverage data:
    • local - local Xdebug driver (default).
    • remote - remote Xdebug driver (disabled by default).
  • filter - various filter options:
    • forceCoversAnnotation - (default: false)
    • mapTestClassNameToCoveredClassName - (default: false)
    • whiltelist - whitelist specific options:
      • addUncoveredFilesFromWhiltelist - (default: true)
      • processUncoveredFilesFromWhitelist - (default: false)
      • include - a list of files or directories to include in whitelist:
        • directories - key containing whitelisted directories to include.
          • suffix - suffix for files to be included (default: '.php')
          • prefix - prefix of files to be included (default: '') (optional)
        • files - a list containing whitelisted files to include.
      • exclude - a list of files or directories to exclude from whitelist:
        • directories - key containing whitelisted directories to exclude.
          • suffix - suffix for files to be included (default: '.php')
          • prefix - prefix of files to be included (default: '') (optional)
        • files - key containing whitelisted files to exclude.
  • report - reporter options:
    • format - specify report format (html, clover, php, text)
    • options - format options:
      • target - target/output directory

Authors

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

Copyright (c) 2013-2016 Anthon Pang, Konstantin Kudryashov everzet and various contributors for portions of code from vipsoft/code-coverage-extension and vipsoft/code-coverage-common projects., (*10)

License

Licensed under BSD-2-Clause License., (*11)

The Versions

10/05 2018

dev-master

9999999-dev

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

10/05 2018

dev-develop

dev-develop

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

09/05 2018

v3.4.1

3.4.1.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

04/05 2018

v3.4.0

3.4.0.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

04/05 2018

v3.3.1

3.3.1.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

13/04 2018

v3.3.0

3.3.0.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

22/03 2018

dev-no-coverage-flag

dev-no-coverage-flag

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

v3.2.1

3.2.1.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

dev-fix-text-report

dev-fix-text-report

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

v3.1.x-dev

3.1.9999999.9999999-dev

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

v3.1.1

3.1.1.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

dev-code-style-guide

dev-code-style-guide

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

dev-fix-default-suffix

dev-fix-default-suffix

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

21/03 2018

dev-readme-fix

dev-readme-fix

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

20/03 2018

dev-appveyor

dev-appveyor

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

17/10 2017

v3.2.0

3.2.0.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

17/10 2017

dev-guzzle6

dev-guzzle6

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

17/10 2017

v3.1.0

3.1.0.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

08/04 2017

v3.0.0

3.0.0.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage

05/04 2017

v2.5.5

2.5.5.0

Generate Code Coverage reports for Behat tests

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by Anthon Pang

bdd test code behat tests generate generation reports report build scenario clover coverage code-coverage