Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » XDebug with simpletest to debug PHP code being tested on another session
XDebug with simpletest to debug PHP code being tested on another session [message #17672] Mon, 30 April 2007 05:45 Go to next message
Francis Upton IV is currently offline Francis Upton IVFriend
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


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 Go to previous message
D Kelsey is currently offline D KelseyFriend
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
Previous Topic:mysqli?
Next Topic:Change font size suggestion
Goto Forum:
  


Current Time: Thu Apr 25 04:27:55 GMT 2024

Powered by FUDForum. Page generated in 0.02956 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top