mahalay/phpspec-coverage-test

PhpSpec 扩展,用于测试代码覆盖率

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

This package is not auto-updated.

Last update: 2024-09-18 06:56:35 UTC


README

一个无需先生成覆盖率报告即可测试代码覆盖率的 PhpSpec 扩展。

用法

配置

创建一个包含以下内容的 phpspec.yamlphpspec.yaml.dist 文件。

# 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

根据需要进行调整设置。然后运行 phpspec 命令!

$ vendor/bin/phpspec run

如果您未安装 xdebug,请使用 phpdbg

$ phpdbg -qrr vendor/bin/phpspec run