mahalay / phpspec-coverage-test
PhpSpec 扩展,用于测试代码覆盖率
v2.0.1
2021-08-24 15:48 UTC
Requires
- php: >=7.3
- friends-of-phpspec/phpspec-code-coverage: ^6.0
- phpspec/phpspec: ^6.0 || ^7.0
Requires (Dev)
- phpro/grumphp: ^0.19 || ^1.0
- squizlabs/php_codesniffer: ^3.6
- symfony/var-dumper: ^5.3 || ^6.0
- vimeo/psalm: ^4.9
Suggests
- ext-xdebug: Install Xdebug to generate phpspec code coverage.
This package is not auto-updated.
Last update: 2024-09-18 06:56:35 UTC
README
一个无需先生成覆盖率报告即可测试代码覆盖率的 PhpSpec 扩展。
用法
配置
创建一个包含以下内容的 phpspec.yaml 或 phpspec.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