【发布时间】:2020-08-24 01:28:50
【问题描述】:
当尝试运行 phpunit 并覆盖 phpdbg 时,我收到错误消息“PHPDBG 的此构建不支持代码覆盖率”。我在产生此错误的 PHAR 行中发现:
if (!\function_exists('PHPUnit\\phpdbg_start_oplog')) {
throw new \PHPUnit\SebastianBergmann\CodeCoverage\RuntimeException('This build of PHPDBG does not support code coverage');
}
然后我运行并得到这个结果:
prompt> ev function_exists('phpdbg_start_oplog');
1
我不明白,问题出在 phpdbg_start_oplog 之前的命名空间中。那么,为什么 PHAR 中的 phpdbg_start_oplog 以 PHPUnit 命名空间为前缀呢?
Sebastian Bergmann 及其贡献者的 PHPUnit 9.1.4。
PHP 7.4.1 (cli)(构建时间:2019 年 12 月 28 日 11:16:02)(NTS)
【问题讨论】: