How to debug a unit test for a WordPress plugin, which uses wordpress-test?

Now I’ve found a solution [to issue 2 above]: I prefixed the external PHP command with: XDEBUG_CONFIG="remote_enable=Off"
and then it didn’t attempt to connect to the debugger.

So, in wordpress-tests/init.php I changed from:

system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) .
    '/bin/install.php' ) . ' ' . escapeshellarg( $config_file_path ) );

to: (note the addition of the XDEBUG_CONFIG line)

$install_blog_cmd =
        'XDEBUG_CONFIG="remote_enable=Off" ' .
        WP_PHP_BINARY .
        ' ' . escapeshellarg( dirname( __FILE__ ) . '/bin/install.php' ) .
        ' ' . escapeshellarg( $config_file_path );
system( $install_blog_cmd );

Update: Now I opened a GitHub issue: https://github.com/nb/wordpress-tests/issues/27

Update: Issue 1, that is, why does the system(...) launched PHP process connect back to the debugger, is probably (?) because in my file /etc/php5/conf.d/xdebug.ini, I have this row:

; Xdebug will always attempt to start a remote debugging session 
; and try to connect to a client, even if the GET/POST/COOKIE
; variable was not present
xdebug.remote_autostart=1