【问题标题】:"Call to undefined method PHPUnit\Framework\TestSuite::sortId()" Error while executing Test Case with Coverage“调用未定义的方法 PHPUnit\Framework\TestSuite::sortId()”执行覆盖测试用例时出错
【发布时间】:2022-01-20 03:32:58
【问题描述】:

调用未定义的方法 PHPUnit\Framework\TestSuite::sortId()

在尝试执行有覆盖率的测试用例时遇到此错误。

命令:

phpunit -v --debug ./Test.php --coverage-clover ../clover.xml

Putput:(前两行)

PHPUnit 9.5.4 by Sebastian Bergmann and contributors.
Runtime:       PHP 7.3.33-1+ubuntu21.10.1+deb.sury.org+1
...

【问题讨论】:

    标签: php phpunit test-suite


    【解决方案1】:

    您似乎混淆了不同的 PHPUnit 安装。

    例如,您可能使用 Composer 安装 PHPUnit,并将 Composer 生成的自动加载器配置为 PHPUnit 的引导脚本,但随后您使用除 vendor/bin/phpunit 之外的可执行文件调用 PHPUnit。

    【讨论】:

      猜你喜欢
      • 2018-10-31
      • 2015-06-15
      • 1970-01-01
      • 2015-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-22
      相关资源
      最近更新 更多