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 的测试覆盖率


基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何替换eregi() 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01