Skip to content

Support XDEBUG_MODE environment variable #834

Description

@derickr
Q A
PHPUnit version 9.4.3
PHP version 7.4.11
Installation Method Composer

Summary

PHPUnit only understands Xdebug modes set in php.ini when checking for coverage availability.

When running:

$ XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text

It is not recognised that the mode is set.

Current behavior

PHPUnit shows a warning:

Warning:       xdebug.mode=coverage has to be set in php.ini

How to reproduce

  • Any repository with phpunit available in vendor/bin/phpunit.
  • Run: XDEBUG_MODE=coverage php -n -dzend_extension=xdebug vendor/bin/phpunit --coverage-text

Expected behavior

Code coverage should have been run, as it would have been with:

php -n -dzend_extension=xdebug -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions