【发布时间】:2018-09-18 10:44:43
【问题描述】:
就我而言:
当我跑步时
vendor/bin/phpunit --coverage-html coverage
错误来了:
PHPUnit 6.5.8 by Sebastian Bergmann and contributors. Error: No code coverage driver is available
然后我安装了 Xdebug
sudo apt-get install php-xdebug
但是当我再次跑步时
vendor/bin/phpunit --coverage-html coverage
它给出了错误:
PHPUnit 6.5.8 by Sebastian Bergmann and contributors. Undefined variable: view
【问题讨论】:
-
Undefined variable: view表示您遇到了错误,并且您解决了代码覆盖率问题。我认为您可以删除有关 Xdebug 的部分,因为它不是问题的一部分。 IIRC,运行vendor/bin/phpunit --coverage-html coverage -vv应该会给你更多信息。 -
@A.L 我照你说的做了,但还是什么也没得到:
vendor/bin/phpunit --coverage-html coverage -vv PHPUnit 6.5.8 by Sebastian Bergmann and contributors. Runtime: PHP 7.1.20-1+ubuntu16.04.1+deb.sury.org+1 with Xdebug 2.6.0 Configuration: /var/www/html/con/phpunit.xml.dist Undefined variable: view -
您可以添加
--debug选项以查看失败的测试。
标签: php visual-studio unit-testing symfony phpunit