Open pionl opened 1 year ago
The code for PHPUnit 9.6 that determines whether Xdebug 3 is loaded and configured for code coverage is here.
The code for PHPUnit 10 is different in that it uses xdebug_info('mode')
when available.
Can you please investigate whether backporting the xdebug_info('mode')
query from the php-code-coverage version used by PHPUnit 10 to the one used by PHPUnit 9 would solve your problem? Thanks!
Hi @sebastianbergmann thank you for the answer, will look into it this week!
Summary
Lately we have changed our docker setup that sets
XDEBUG_MODE=debug
(based on .env file) and it broke our execution of tests with code coverage in PHPStorm.Currently we are able to bypass it by using different PHPStorm run configuration that forces
XDEBUG_MODE=coverage
.Current behavior
PHPUnit outputs a warning:
PHPStorm runs the tests with
php -dxdebug.mode=coverage /app/vendor/phpunit/phpunit/phpunit
which ensures that xdebug should use coverage value but PHPUnit uses XDEBUG_MODE environment variable with higher priority.I've checked this by checking
xdebug_info
.debug.php
I was able to test this in PHPUnit 9 (don't have a project on PHP10), but the code seems same?
Is this expected behavior?
How to reproduce
Expected behavior
Code coverage should be collected.
Thank you for your time!