Is it possible to debug PhpUnit tests with --process-isolation option?

For unittest

class SampleTest extends PHPUnit_Framework_TestCase
{
    public function testBreakpoint()
    {
        $a = 18;
    }
}



with breakpoint on line 5 "$a = 18;",
Xdebug v2.1.0,
PHPUnit 3.6.10,
PHP 5.3.6,
PHPStorm 3.0.3.


Running unittest with NO --process-isolation option in 'Test Runner options' in 'Run/Debug Configuration ' by Shift-F9 'Debug' stops execution on line 5, as expected.

Running the same  'Run/Debug Configuration '  WITH --process-isolation option in 'Test Runner options' by Shift-F9 'Debug' does not stop execution on line 5.


The option --process-isolation runs every testcase in new process using 'proc_open' in runJob function in https://github.com/sebastianbergmann/phpunit/blob/3.6/PHPUnit/Util/PHP.php


Is it possible to debug child process created by PhpUnit  using Xdebug and PhpStorm?

6 comments
Comment actions Permalink

Hello Alex,

Unfortunately it haven't not supported yet. Please vote for the following issue - http://youtrack.jetbrains.com/issue/WI-7355.

Thank you for feedback!
0
Comment actions Permalink

Thank you Nikolay for quick and exact answer.
The issue is upvoted. Hope to see it in V4.

0
Comment actions Permalink

I am facing the same problem, the mentioned issue seems to be fixed but debugging of isolated process still ignores break points. As before, they work fine without process isolation. Is there a way to make this work?

0
Comment actions Permalink

Since it would be new/isolated process .. the xdebug debug status may not propagate there.

See if configuring xdebug with xdebug.remote_autostart = 1 will do any better  (so that xdebug attempts to debug every single request) -- it should.

0
Comment actions Permalink

:O:O:O:O:O:O:O WORKS!

0
Comment actions Permalink

For others who might be wondering, make sure to Run > Start Listen for PHP Debug Connections.

0

Please sign in to leave a comment.