【问题标题】:phpunit generate coverage report in html format for specific folder onlyphpunit 仅针对特定文件夹生成 html 格式的覆盖率报告
【发布时间】:2014-02-18 11:01:18
【问题描述】:

我只想为我的课程生成coverhtml,目前我正在使用类似的命令,

    phpunit --coverage-html=../../coverage ../../test/assertion.php

但它也在测试供应商文件夹中的代码。

【问题讨论】:

  • 使用引导程序或 XML 文件作为选项来包含/排除目录。

标签: php unit-testing phpunit


【解决方案1】:

使用 XML 文件,您可以包含您要处理的目录,并排除您不想处理的目录。

<filter>
    <whitelist processUncoveredFilesFromWhitelist="true">
        <directory suffix=".class">.</directory>
        <directory suffix=".fn">.</directory>
        <directory suffix=".php">.</directory>
        <exclude>
            <directory>ExternalLibraries</directory>
        </exclude>
    </whitelist>
</filter>

【讨论】:

    猜你喜欢
    • 2011-03-09
    • 1970-01-01
    • 2014-03-21
    • 1970-01-01
    • 2012-05-07
    • 2022-11-08
    • 2012-08-23
    • 1970-01-01
    • 2016-01-28
    相关资源
    最近更新 更多