-
-
Notifications
You must be signed in to change notification settings - Fork 377
XDebug environment variable takes precedence over ini option #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That code is not in PHPUnit but in php-code-coverage. |
Yes, you're right. But is the ticket good here? Or should I submit it somewhere else? |
I already moved it. |
I'm also experiencing this problem while using PhpStorm's code coverage feature. Is this something that is likely to be addressed? Thanks
|
I do not plan to make any changes to PHPUnit 9.6 (and its dependencies) anymore aside from keeping them compatible with new versions of PHP. |
Issue: XDebug code coverage not working with "php -dxdebug.mode=coverage" option
Description:
I'm trying to run PHPUnit tests with code coverage in PhpStorm. I use the following command:
However, even though the -dxdebug.mode=coverage option is passed, I still get a warning that
XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set
. And the code coverage dialog does not appear.Upon checking the PHPUnit code, I found that it checks for the XDEBUG_MODE environment variable first, before checking the xdebug.mode ini option. And even though the ini option is passed, it still checks for the environment variable, which is set in my case to something else.
Here's the relevant code from PHPUnit:
I checked the environment variables using var_dump(getenv('XDEBUG_MODE')); and found that it is set to
debug,develop
.It seems that the getenv() function takes precedence over the
-dxdebug.mode
option. Can this behavior be changed so that the passed ini option takes precedence over the environment variable?Expected result:
The
-dxdebug.mode=coverage
option should enable code coverage without the need for setting the XDEBUG_MODE environment variable.Actual result:
The
-dxdebug.mode=coverage
option is not recognized as enabling code coverage, and the XDEBUG_MODE environment variable needs to be set.Environment:
The text was updated successfully, but these errors were encountered: