<testsuite name="Application Test Suite">
<directory>./application/</directory>
</testsuite>
<filter>
<blacklist>
HERE
</blacklist>
or alternatively
<whitelist>
<directory suffix=".php">../library/</directory>
<directory suffix=".php">../application/</directory>
<exclude>
AND HERE
<directory suffix=".phtml">../application/</directory>
</exclude>
</whitelist>
</filter>
2
您可以在文件开头使用@codeCoverageIgnore作为注释,以获得100%0/0覆盖率 .
<?php // @codeCoverageIgnoreStart
interface MyInterface
{
public function myfunction();
}
2 回答
使用phpunit.xml时,您可以设置过滤器以排除具有特定名称的文件,特别是文件夹或具有特定扩展名的文件 .
见the documentation for it
Example:
您可以在文件开头使用@codeCoverageIgnore作为注释,以获得100%0/0覆盖率 .
请注意,它在注释块中不起作用 .
在PHPUnit的github上打开问题:https://github.com/sebastianbergmann/phpunit/issues/497