View Issue Details

IDProjectCategoryView StatusLast Update
0001895XdebugCode Coveragepublic2020-11-26 17:26
Reporterkasper Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Platformx86_64 GNU/LinuxOSDebian GNU/LinuxOS Version10 (buster)
Product Version3.0.0RC1 
Target Version3.0dev 
Summary0001895: XDEBUG_MODE is ignored
DescriptionWe generate code coverage reports with phpunit. Since updating to xdebug 3.0.0, this has broken, with the warning that `xdebug.mode=coverage has to be set in php.ini`. After looking at the documentation, we decided that setting `XDEBUG_MODE=coverage` should work for our needs, but it does not.
Steps To Reproduce1. Install xdebug 3.0.0 (and enable it)
2. Set `XDEBUG_MODE=coverage`
3. In a project with phpunit required and configured, run `./vendor/bin/phpunit --coverage-text`

Expected outcome: it works without warning

Actual outcome: It gives `Warning: xdebug.mode=coverage has to be set in php.ini` and gives no coverage output
TagsNo tags attached.
Operating System
PHP Version7.4.0-7.4.4

Activities

derick

2020-11-26 17:26

administrator   ~0005544

This is not a bug in Xdebug, but in PHPUnit.

In "Xdebug3Driver.php" it specifically tests for just ini settings:

<code>
 55 if (!ini_get('xdebug.mode') || !in_array('coverage', explode(',', ini_get('xdebug.mode')), true)) {
 56 throw new Xdebug3NotEnabledException;
 57 }
</code>

Where it should also allow it for 'coverage' being part of `getenv("XDEBUG_MODE");`

I've filed a bug report with PHPUnit: https://github.com/sebastianbergmann/phpunit/issues/4526

Issue History

Date Modified Username Field Change
2020-11-26 14:20 kasper New Issue
2020-11-26 17:04 derick Target Version => 3.0dev
2020-11-26 17:26 derick Assigned To => derick
2020-11-26 17:26 derick Status new => closed
2020-11-26 17:26 derick Resolution open => no change required
2020-11-26 17:26 derick Note Added: 0005544