Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using netbeans, xdebug, symfony and phpunit together

I installed xdebug on my Apache and if I define a breakpoint in Netbeans, the execution breaks fine. But if I execute the tests with symfony phpunit:test-all, the execution will not break on the given break point.

Any ideas? cowabunga!

like image 471
cowabunga1984 Avatar asked Jan 22 '23 20:01

cowabunga1984


1 Answers

To debug a command-line script, export the XDEBUG_CONFIG variable first, like so:

export XDEBUG_CONFIG="idekey=netbeans-xdebug" (Unix/Linux/OS X)

set XDEBUG_CONFIG=idekey=netbeans-xdebug (Windows)

(Note: I did not test the Windows command. You may have to escape the = character, or the command may look a bit different. If that's the case, I hope someone comes along and corrects me in a comment.)

Explanation: When you open a debugging session for a script that runs through Apache, NetBeans will open your browser to a URL that ends with "XDEBUG_SESSION_START=netbeans-xdebug". When this happens, Xdebug knows to intercept this argument and give your browser a cookie with this debug session information.

The command above is the equivalent for setting the cookie in the command line environment.

like image 125
i-g Avatar answered Jan 28 '23 09:01

i-g