是否可以使用--process-isolation选项调试PhpUnit测试? [英] Is it possible to debug PhpUnit tests with --process-isolation option?

查看:83
本文介绍了是否可以使用--process-isolation选项调试PhpUnit测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于单元测试

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

第5行带有断点"$ a = 18;",

with breakpoint on line 5 "$a = 18;",

  • Xdebug v2.1.0,
  • PHPUnit 3.6.10,
  • PHP 5.3.6,
  • ubuntu 10.11

运行带有NO的unittest --process-isolation选项可以按预期在第5行停止脚本执行. 使用--process-isolation选项运行相同的配置不会在第5行停止执行.

Running unittest with NO --process-isolation option stops script execution on the line 5, as expected. Running the same configuration WITH --process-isolation option does not stop execution on line 5.

--process-isolation选项使用

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

已通过PhpStorm 3和vim 7与调试器插件一起进行了测试.它允许调试PHPUnit本身,但不能调试用例.

Tested with PhpStorm 3 and vim 7 with debugger plugin. It allows to debug PHPUnit itself, but not testcases.

有什么方法可以使用Xdebug调试PhpUnit创建的子进程?可能是Zend Debugger?

Is there any way to debug the child process created by PhpUnit using Xdebug? may be Zend Debugger?

推荐答案

如问题评论中所述.问题是 PHP Storm不支持​​多个并行调试会话

As stated in the comments on the question. The issue is that PHP Storm didn't support multiple parallel debugging sessions.

这篇关于是否可以使用--process-isolation选项调试PhpUnit测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆