How to debug PHPUnit-Testcases with PHPStorm using the PHPUnit-Framework?
I have got a file which contains some PHPUnit-Testcases. I can run the tests on the command line using the following command "phpunit --group Mswebdesign_Test UnitTests.php".
I have also created an accordant Run-Configuration in PHPStorm to run my tests. So far, so good.
But I have no idea how I can debug my Testfile in PHPStorm while calling it by the PHPUnit-Framework. I have tried the normal "Debug"-Command, but that - of course - is not what I want. I need some command like "Debug as PHPUnit-Test". I haven't found anything on this subject in the web or in the documentation. Could anybody give me a hint?
Please sign in to leave a comment.
Hi Werner,
Have you tried presing "Debug" button instead of "Run" (in main toolbar, next to configuration name) ?
Obviously, you need fully working/configured xdebug or zend debugger + breakpoints
P.S.
I have not done this myslf (PHPUnit tests debugging), but that how it supposed to work.
Hi Andriy,
I'm quite new to PHPStorm and you give me the right hint: just pressing the "Debug" button instead of "Run" solved the problem....- :)
Thank you very much!