toyota
toyota

Reputation: 1

PHPUnit xdebug.coverage_enable=On message

How to get through "You need to set xdebug.coverage_enable=On in your php.ini." message? I have set xdebug.coverage_enable=On in the proper (--ini) php.ini file but it had no effect. Im on mac os x snow leopard

Upvotes: 0

Views: 1327

Answers (1)

Anti Veeranna
Anti Veeranna

Reputation: 11583

What version of xdebug are you using?

php --ri xdebug

will tell you that version (amongst everything else)

PHP_CodeCoverage 1.0.2 (which is used by PHPUnit to collect code coverage information) has this bit of source code

if (version_compare(phpversion('xdebug'), '2.2.0-dev', '>=') &&
    !ini_get('xdebug.coverage_enable')) {
    die("You need to set xdebug.coverage_enable=On in your php.ini.\n");
}

Based on this logic you would get this error only if you have installed xdebug 2.2.0-dev. Which, in my opinion should not be used before it is stable.

xdebug 2.1.0 is stable and works well enough.

If you however are not running 2.2.0-dev, then this starts to look like a bug, and you need to give more information about what versions of everything relevant you are using.

Update - it looks like this was an actual bug in PHP_CodeCoverage that was fixed in 1.0.2 3 days ago. You probably had an older version. Upgrade, and it should be fine now.

Upvotes: 1

Related Questions