Enable xdebug only for PHPUnit command line

Published 18 March 2020 21:00

I don't want to enable xdebug for my normal PHPUnit test but only for the coverage report. Therefor I made a shortcut.

In my composer.json file I made this script:

{
  "scripts": {
    "coverage": "php -d zend_extension=xdebug.so ./vendor/bin/phpunit --prepend build/xdebug-filter.php --coverage-html build/coverage-report --coverage-text"
}
}

For more information see stackoverflow.

Robin Dirksen

Robin Dirksen

On my blog you can find articles that I've found useful. This is just a simple blog built with Wink.