Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In PHPStorm, How to breakpoint in a method of a PHPUnit class?

In PHPStorm, I want to debug a PHPUnit class. If I set a breakpoint in a method of the unit-testing class (the class that inherits from PHPUnit_Framework_TestCase), whenever I run the test, PHPStorm executes the test, but never stops at the breakpoint, even though there are breakpoints in other places where it used to stop.

Is that a bug in PHPStorm ? how to stop in a PHPUnit_Framework_TestCase's method ?

like image 735
Tar Avatar asked Oct 02 '12 15:10

Tar


2 Answers

in order PHPStorm to stop at the breakpoint within tests you must "Debug" (Shift + F9) but not "Run" (Shift + F10) your configuration.

like image 106
Alstas Avatar answered Sep 21 '22 00:09

Alstas


If your test case has the @runInSeparateProcess comment or in the phpuint.xml configuration file the <phpunit processIsolation="true"> tag has the processIsolation attribute and the value of it is true than debugger will not stop on the breakpoint because it is running in a separate thread.

like image 32
Zsolt Restyánszki Avatar answered Sep 19 '22 00:09

Zsolt Restyánszki