【发布时间】:2013-09-06 10:03:52
【问题描述】:
我有 netbeans 在调试模式下运行。现在我想使用 ?XDEBUG_SESSION_START=netbeans-xdebug 运行单元测试,目标是在运行时设置断点。有可能吗?
我尝试过这样的事情:
phpunit myTest.php?XDEBUG_SESSION_START=netbeans-xdebug
不起作用。有什么想法吗?
更新
据此:http://blog.doh.ms/2011/05/13/debugging-phpunit-tests-in-netbeans-with-xdebug/
转到命令行并运行 phpunit-debug。现在开始调试,如果你选择了“Stop on first line”,你的IDE会打开phpunit文件,点击play就可以了。
如果我运行 phpunit --debug
Starting test 'xxxx'
OK (1 test, 4 assertions)
问题是,它从未捕获我在控制器中的断点。为什么抓不到呢?是否有可能是因为它是使用以下方式执行的:
$this->dispatch('/ajax/update-bla');
【问题讨论】: