我有一个小型 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/