【问题标题】:How to generated detailed code coverage report with xdebug?如何使用 xdebug 生成详细的代码覆盖率报告?
【发布时间】:2019-07-13 22:04:03
【问题描述】:

我正在使用 PHPUnit 8.0.4,我的报告如下所示:

  Classes:  0.00% (0/1)
  Methods: 37.50% (9/24)
  Lines:   55.91% (123/220)

我正在使用如下所示的参数运行命令:

phpunit --coverage-html build/coverage-report --configuration phpunit.xml --testsuite query-parser

这些是我在 phpunit.xml 中的日志设置:

    <logging>
        <log type="coverage-html" target="./tmp/report" lowUpperBound="35"
             highLowerBound="70"/>
        <log type="coverage-clover" target="./tmp/coverage.xml"/>
        <log type="coverage-php" target="./tmp/coverage.serialized"/>
        <log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
        <log type="junit" target="./tmp/logfile.xml"/>
        <log type="testdox-html" target="./tmp/testdox.html"/>
        <log type="testdox-text" target="./tmp/testdox.txt"/>
    </logging>

我想看看哪些行和方法没有被覆盖,以便编写其他测试以实现 100% 的代码覆盖率。

这是我的 html 报告

【问题讨论】:

  • 这对我来说感觉很不清楚 .. 可能只是我 ..
  • 什么不清楚?

标签: php xdebug php-7 phpunit


【解决方案1】:

您似乎创建了各种格式的代码覆盖率报告,但只查看纯文本格式的报告(IMO 没用)。打开 ./tmp/report/index.html 以查看 HTML 报告。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-23
    • 2010-09-08
    • 1970-01-01
    • 2021-06-26
    • 2018-06-03
    相关资源
    最近更新 更多