I would also like to be able to do this but have never tried. The debug messages from PHPUnit are pretty cryptic.
Mick
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've recently started doing Unit Tests using PHPUnit which I absolutely love! The issue is that I'd like to be able to use xdebug while doing these tests to debug the issues I encounter and I get the following error:
vagrant:///Users/christopherwilbraham/ubuntu_xenial64/usr/bin/php /var/www/html/intranet/vendor/phpunit/phpunit/phpunit --no-configuration --filter /TestHolidayDateCheck::testHolidayDates$/ /var/www/html/intranet/PHPUnitTests/TestHolidayDateCheck.php --teamcity
Testing started at 11:18 AM ...
Failed loading /etc/php/7.0/mods-available/xdebug.ini: /etc/php/7.0/mods-available/xdebug.ini: invalid ELF header
PHPUnit 6.3.0 by Sebastian Bergmann and contributors.
Thanks in advance for the help!
Chris
Figured out the issue. My settings for CLI were incorrect. This link was helpful: https://confluence.jetbrains.com/display/PhpStorm/Debugging+PHP+CLI+scripts+with+PhpStorm
Once this is set you can right-click on the unit test and choose debug.
Please or to participate in this conversation.