Hi all,
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!
Hi all,
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!
When you say you define a breakpoint in Netbeans and it breaks fine, are you talking about running the unit tests from within Netbeans, or running a web application that triggers the breakpoints in Netbeans?
Either way, my first guess would be that the two scenarios are using different PHP.INI files. Get one of your unit tests to dump configuration information and you'll see pretty quickly I daresay. Find the PHP.INI that's being used on the command line and make sure that XDebug is set up for that scenario.
I hope that makes sense. I'm entirely coffee-free at the moment.
I don't use netbeans but I don't think netbeans modifies the file you put break points in and I don't think that symfony can read your netbean configuration to find out where to break.
Also if you are running the test all task inside netbeans and expect the test files to break I don't think that will work either as the task forks php processes I believe and these processes won't be readable by netbeans.
All hypothesis of course.
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.