Test coverage on PHPUnit 6.5.5 and PHP 7.2(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 的测试覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHPUnit 6.5.5 和 PHP 7.2 的测试覆盖率


- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- Laravel 仓库 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01