简体   繁体   English

PHPUnit白名单代码覆盖率

[英]PHPUnit whitelist code coverage

The whitelist isn't working how I would expect when get code coverage reports. 白名单无法正常工作,获取代码覆盖率报告时我所期望的那样。 I am using Zend Framework and my Zend files are also in the library directory just like the project quickstart. 我正在使用Zend Framework,我的Zend文件也位于库目录中,就像项目快速入门一样。

I'm running PHPUnit 3.6 from Netbeans 7.0.1 我正在从Netbeans 7.0.1运行PHPUnit 3.6

I only really want to see the coverage for the classes for MyLib . 我只想真正了解MyLib的课程范围。

<whitelist>
    <directory suffix=".php">../../library/MyLib</directory>
</whitelist>

But in the report I seem to get a percentage value for several Zend files eg. 但是在报告中,我似乎得到了几个Zend文件的百分比值,例如。 Zend_Controller_Front , Zend_Loader_Autoloader etc. Zend_Controller_FrontZend_Loader_Autoloader

Obviously I haven't written any tests for these classes and it is no surprise that I have 0% coverage. 显然,我没有为这些类编写任何测试,而且覆盖率达到0%也就不足为奇了。

What have I missed? 我错过了什么?

Please use absolute paths in your XML file and/or ensure those are correctly resolved by your phpunit test-runner call. 请在XML文件中使用绝对路径和/或确保通过phpunit测试运行程序调用正确解析了这些绝对路径。 Also ensure that your XML file is loaded. 还要确保您的XML文件已加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM