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 中的请求之间持久化对象 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01