Cobertura 格式的 PHPUnit 覆盖率

标签 php phpunit code-coverage cobertura

我有一个小型 PHP 项目,它使用 PHPUnit 进行单元测试和覆盖。我想生成 cobertura XML 格式的覆盖率报告。

我可以使用任何工具或插件来实现这一目标吗?

感谢任何帮助..

最佳答案

对 Cobertura 格式的支持刚刚合并到 phpunit 和 phpcov 中,并且在 phpunit 9.4 中可用

可以通过使用此标志调用 phpunit 来生成报告:

phpunit --coverage-cobertura=my-cobertura-coverage.xml

关于Cobertura 格式的 PHPUnit 覆盖率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23101748/

相关文章:

docker - 流明:PHPUnit失败,但在Gitlab CI Runner中通过了测试

javascript - Jasmine + Istanbul 尔覆盖不起作用

php - 为 MYSQL 创建最近 30 天的 View

添加到函数时 PHP $.row 错误

已命名静态构造函数的 PHPUnit 模拟类

php - 如何在 Slim 2 和 PHPUnit 中测试重定向?

xcode - undefined symbol ___llvm_profile_runtime

android - 使用 orchestrator 覆盖 android 测试

php - 无法写入 session 数据(内存缓存)

php - 如何使用 AWS/nginx/Zend 制作站点到站点 VPN