This is not an ideal answer, but you can surround any block of code with xdebug_start_trace () and xdebug_stop_trace () with calls to create a stack trace for the target code block. I used this to see exactly what happens at certain points in my unit tests when testing other people's code.
class SampleTest extends PHPUnit_Framework_TestCase
{
public function testBreakpoint()
{
xdebug_start_trace('/tmp/testBreakPointTrace');
$a = 18;
xdebug_stop_trace();
}
}
Just keep in mind that any failures will cause the PHPUnit exception handler to intervene and make the stack trace look a little strange. If you get an error message, you can get a clean trace by adding output; call immediately after xdebug_stop_trace:
class SampleTest extends PHPUnit_Framework_TestCase
{
public function testBreakpoint()
{
xdebug_start_trace('/tmp/testBreakPointTrace');
$a = 18;
xdebug_stop_trace();
exit;
}
}
source
share