小编Gav*_*ove的帖子

在命令行中为 PHPunit 设置 xdebug.coverage_enable=On

我不想为所有脚本打开 xdebug 代码覆盖率,但我确实希望能够为生成代码覆盖率的每日 jenkins 构建打开它。

我尝试了以下

phpunit -d xdebug.coverage_enable=1 -c phpunit-coverage.xml.dist
Run Code Online (Sandbox Code Playgroud)

但是我总是收到以下错误

Configuration read from phpunit-coverage.xml.dist


Fatal error: Uncaught exception 'PHP_CodeCoverage_Exception' with message 'You need to set xdebug.coverage_enable=On in your php.ini.' in /usr/local/lib/php/PHP/CodeCoverage/Driver/Xdebug.php on line 72

PHP_CodeCoverage_Exception: You need to set xdebug.coverage_enable=On in your php.ini. in /usr/local/lib/php/PHP/CodeCoverage/Driver/Xdebug.php on line 72

Call Stack:
    0.0002     627488   1. {main}() /usr/local/bin/phpunit:0
    0.0050    1095880   2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:46
    0.0050    1096608   3. PHPUnit_TextUI_Command->run() /usr/local/lib/php/PHPUnit/TextUI/Command.php:130
    0.6419   39830848   4. PHPUnit_TextUI_TestRunner->doRun() /usr/local/lib/php/PHPUnit/TextUI/Command.php:192
    0.9760   40345400   5. PHP_CodeCoverage->__construct() /usr/local/lib/php/PHPUnit/TextUI/TestRunner.php:258
    0.9764   40358504   6. …
Run Code Online (Sandbox Code Playgroud)

phpunit

5
推荐指数
3
解决办法
8359
查看次数

标签 统计

phpunit ×1