peridot-php/peridot-code-coverage-reporters
Composer 安装命令:
composer require peridot-php/peridot-code-coverage-reporters
包简介
Code coverage reporters for Peridot PHP.
README 文档
README
Installation
Add this package as a dependency:
composer require --dev peridot-php/peridot-code-coverage-reporters
Then register the reporters in your peridot.php configuration:
use Evenement\EventEmitterInterface; use Peridot\Reporter\CodeCoverage\CodeCoverageReporter; use Peridot\Reporter\CodeCoverageReporters; return function (EventEmitterInterface $emitter) { $coverage = new CodeCoverageReporters($emitter); $coverage->register(); $emitter->on('code-coverage.start', function (CodeCoverageReporter $reporter) { $reporter->addDirectoryToWhitelist(__DIR__ . '/src'); }); };
Usage
This package provides several Peridot reporters that can be used via the
--reporter option:
html-code-coveragetext-code-coverageclover-code-coveragexml-code-coveragecrap4j-code-coveragephp-code-coverage
These reporters are all driven by php-code-coverage, which requires the use of
either the phpdbg executable, or the xdebug PHP extension in order to
produce coverage reports.
With phpdbg
Where available, phpdbg is generally recommended for faster coverage
reporting. Most system-level package management tools should be able to install
a version of phpdbg with minimal hassle. Under Homebrew, for example,
phpdbg can be installed like so:
brew tap homebrew/homebrew-php && brew install php71 --with-phpdbg
Once installed, phpdbg -qrr can be used in place of php when executing
scripts, including the peridot binary, allowing code coverage to be generated:
phpdbr -qrr vendor/bin/peridot --reporter spec --reporter html-code-coverage
The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed.
With xdebug
Use of xdebug is no longer recommended, because of the significantly worse
performance compared to phpdbg. If phpdbg is not an option, simply make sure
the xdebug extension is enabled when running peridot:
vendor/bin/peridot --reporter spec --reporter html-code-coverage
The above command will print spec-style output while the suite runs, and generate an HTML coverage report once the suite has completed.
peridot-php/peridot-code-coverage-reporters 适用场景与选型建议
peridot-php/peridot-code-coverage-reporters 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 71.78k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2014 年 10 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 peridot-php/peridot-code-coverage-reporters 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 peridot-php/peridot-code-coverage-reporters 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 71.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 14
- 依赖项目数: 20
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-29