如何从phpunit覆盖率报告中排除目录

时间:2013-08-13 06:31:14

标签: cakephp phpunit

我在写 -

<?xml version="1.0" encoding="UTF-8"?>

    <testsuites>
      <testsuite name="My Test Suite">
         <directory suffix=".php">Test/Case/Model</directory>
        <exclude>Test/Case/Model/Behavior</exclude>
      </testsuite>
    </testsuites>

但它不会排除覆盖率报告中的行为。如何从覆盖率报告中排除这些目录或文件?

1 个答案:

答案 0 :(得分:13)

<?xml version="1.0" encoding="utf-8"?>
<phpunit>
  <filter>
    <whitelist>
      <directory suffix=".php">../</directory>
      <exclude>
        <file>../ext_emconf.php</file>
        <directory suffix=".php">../tests</directory>
      </exclude>
    </whitelist>
  </filter>
</phpunit>