guitarneck / php-coverage
PHP 覆盖率报告工具和框架
1.0.0
2022-11-28 22:05 UTC
Requires
- php: >=5.6.0
- composer-runtime-api: ^2.0.0
Requires (Dev)
- ext-uopz: ^6.1.2
- guitarneck/taphp: ^1.0
Suggests
- ext-pcov: *
- ext-xdebug: *
This package is auto-updated.
Last update: 2024-09-29 02:02:27 UTC
README
PHP 覆盖率
A PHP 框架,用于检索代码覆盖率并获取以各种格式生成的报告。
可以与以下覆盖率处理器一起使用
并导出以下格式
- clover
- 覆盖率
- coveralls
- dot (仅限 xdebug)
- dump (仅限 xdebug)
- export (PHP 导出)
- json (PHP 字符串化)
- lcov
- raw
- serialize (PHP 序列化)
目录
安装
composer require guitarneck/php-coverage --dev
命令
- 使用 php
$ php bin/coverage <file> [args...]
- 使用 phpdbg
$ phpdbg -qrr bin/coverage <file> [args...]
选项
--debug Show debug informations.
--excludes=,--excludes,-x The paths to exclude. Separated by ','.
Ex: vendor/,tests/,inc/lib/
--format=,--format,-f The file format to be generated.
[clover|coverage|coveralls|dot|dump|export|json|lcov|raw|serialize]
dft: coverage
--handler=,--handler The handler to use for coverage.
[xdebug|phpdbg|pcov]
dft: xdebug
--help,-h This help page
--includes=,--includes,-i The paths to include. Separated by ','.
Ex: src/,inc/
--no-extra-filter Do not apply extra filtering (includes & excludes).
--output-path=,--output-path,-p The paths to output. Separated by ','.
Ex: {DIR},..,reports
- {DIR}: __DIR__ ('coverage/sources')
- .. : parent path
配置
默认配置可以设置在 sources/Coverage.json
使用 .dot
Grahpviz 是开源的图形可视化软件。
$ dot -Tsvg reports\\Hello.dot > Hello.svg