PHPUnit代码覆盖率跳过某些行
由于某种原因,php单元的代码覆盖特性跳过了某些行。我已经玩了很多次了,如果我只是PHPUnit代码覆盖率跳过某些行,php,phpunit,Php,Phpunit,由于某种原因,php单元的代码覆盖特性跳过了某些行。我已经玩了很多次了,如果我只是echo($hydrationData['partnerNames'),覆盖范围很好。我已尝试使用--verbose和--debug运行测试,但没有发出任何信息。我在PHPUnit版本4.0和4.4中尝试过这一点 if(isset($hydrationData['partnerNames'])) { // this line will be marked as not covered
echo($hydrationData['partnerNames')代码>,覆盖范围很好。我已尝试使用--verbose
和--debug
运行测试,但没有发出任何信息。我在PHPUnit版本4.0和4.4中尝试过这一点
if(isset($hydrationData['partnerNames'])) {
// this line will be marked as not covered
unset($hydrationData['partnerNames']);
// got here will be printed during unit test and this line marked as covered
echo('got here');
}
听起来像是在PHP的Zend引擎(可能)或Xdebug(不太可能)中找到了一个
在PHP_CodeCoverage或PHPUnit中,我们对此无能为力。谢谢Sebastian,我感谢您在项目中的工作!