mahalay/phpspec-coverage-test

PhpSpec extension for testing code coverage

v2.0.1 2021-08-24 15:48 UTC

This package is not auto-updated.

Last update: 2024-05-01 04:53:51 UTC


README

A PhpSpec extension for testing code coverage without the need for coverage report being generated first.

Usage

Config

Create a phpspec.yaml or phpspec.yaml.dist file containing the following.

# phpspec.yaml.dist
formatter.name: pretty
suites:
  default_suite:
    namespace: Mahalay\PhpSpec\CoverageTest
    psr4_prefix: Mahalay\PhpSpec\CoverageTest

extensions:
  FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension:
    format:
      - html
    output:
      html: coverage

  Mahalay\PhpSpec\CoverageTest\Extension:
    min_coverage: 100.0

Adjust these settings accordingly. Then phpspec on!

$ vendor/bin/phpspec run

If you don't have xdebug installed use phpdbg

$ phpdbg -qrr vendor/bin/phpspec run