PHPUnit 6.5.5 和 PHP 7.2 的测试覆盖率 [英] Test coverage on PHPUnit 6.5.5 and PHP 7.2

查看:21
本文介绍了PHPUnit 6.5.5 和 PHP 7.2 的测试覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是带有switch case的行没有被覆盖,switch case本身正在被执行.

the problem is that lines with the switch case are not covered, the switch cases themselves are being executed.

在 Windows 上测试

Tested on windows

推荐答案

输出在技术上是正确的,因为 PHP 7.2 现在很聪明,不再需要运行 case 语句.我在 https://derickrethans.nl/php7.2-switch.html

The output is technically correct, as PHP 7.2 is now clever and no longer needs to run the case statements. I wrote about these optimisations at https://derickrethans.nl/php7.2-switch.html

尽管如此,这是不受欢迎的行为,因此 Xdebug 使用 https 修复了这个错误"://github.com/xdebug/xdebug/commit/0690bf83109228a67dfe14a9a312045435b7b774 — 这是 GitHub 上 Xdebug 代码的一部分,但尚未发布.它将进入 Xdebug 2.6.0beta2.

Nevertheless, this is unwanted behaviour, and hence Xdebug has this "bug" fixed with https://github.com/xdebug/xdebug/commit/0690bf83109228a67dfe14a9a312045435b7b774 — this is part of Xdebug's code on GitHub, but has not made it yet into a release. It will make it into Xdebug 2.6.0beta2.

这篇关于PHPUnit 6.5.5 和 PHP 7.2 的测试覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆