XDebug with simpletest to debug PHP code being tested on another session [message #17672] |
Mon, 30 April 2007 05:45 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
I'm using the XDebug support which works just great.
I'm debugging an automated test with Drupal, which uses the simpletest
PHP framework. I am able to debug the PHP code invoked from Eclipse
just fine, however, I want to debug the PHP code that the test framework
invoked. For browser-based tests, simpletest issues an HTTP request to
the webserver starting a different PHP session to execute the code under
test.
I added the XDebug cookie to this HTTP request in hopes of being able to
have the XDebug client recognize the execution of this different
session, but it does not see the breakpoints in the new session. Here
is the code for adding the cookie:
$this->_browser->_user_agent->_cookie_jar->setCookie('XDEBUG_SESSION',
$_COOKIE['XDEBUG_SESSION']);
I suspect that the PHP session Id cookie is also used to co-relate with
the debug client (having not yet looked at the XDebug source -- that's
next).
Is there a way to do this (debug the PHP code under test?)?
Thanks,
Francis
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Re: XDebug with simpletest to debug PHP code being tested on another session [message #17686 is a reply to message #17672] |
Mon, 30 April 2007 12:30 |
D Kelsey Messages: 232 Registered: July 2009 |
Senior Member |
|
|
Francis, currently the XDEBUG_SESSION for web based interaction is set
to "ECLIPSE_XDEBUG".
So so long as XDebug can see this cookie, then it will attempt to debug.
There is another way to get xdebug to be in debug mode, try setting
xdebug.remote_autostart=On
in PHP.INI
If you still find things not breaking on break points, then check that
the file you are setting the breakpoint on in eclipse is the same phsyical
file being executed. If it isn't then you either have to setup you environment
for it to be or make use of a pathmapper.
The latest version has a sample pathmapper included and documentation on this
Cheers
Dave
Francis Upton wrote:
> I'm using the XDebug support which works just great.
>
> I'm debugging an automated test with Drupal, which uses the simpletest
> PHP framework. I am able to debug the PHP code invoked from Eclipse
> just fine, however, I want to debug the PHP code that the test framework
> invoked. For browser-based tests, simpletest issues an HTTP request to
> the webserver starting a different PHP session to execute the code under
> test.
>
> I added the XDebug cookie to this HTTP request in hopes of being able to
> have the XDebug client recognize the execution of this different
> session, but it does not see the breakpoints in the new session. Here
> is the code for adding the cookie:
>
>
> $this->_browser->_user_agent->_cookie_jar->setCookie('XDEBUG_SESSION',
> $_COOKIE['XDEBUG_SESSION']);
>
>
> I suspect that the PHP session Id cookie is also used to co-relate with
> the debug client (having not yet looked at the XDebug source -- that's
> next).
>
> Is there a way to do this (debug the PHP code under test?)?
>
> Thanks,
>
> Francis
|
|
|
Powered by
FUDForum. Page generated in 0.03959 seconds