phpunit调试只进入phpunit.phar文件

phpunit调试只进入phpunit.phar文件,phpunit,phpstorm,xdebug,Phpunit,Phpstorm,Xdebug,我正试图通过PHPStorm使用XDebug调试单元测试 测试在服务器上正确运行。 当我在PHPStorm中打开调试并在服务器上启用远程调试时,PHPStorm将打开phpunit文件,并告诉我这是它所在的行。 如果我单击continue,它将永远不会到达单元测试中的断点;我百分之百肯定它被击中了 我已将以下内容添加到我的:/etc/php5/cli/php.ini中 xdebug.remote_enable=1 xdebug.remote_port=9020 xdebug.idekey=PHP

我正试图通过PHPStorm使用XDebug调试单元测试

测试在服务器上正确运行。 当我在PHPStorm中打开调试并在服务器上启用远程调试时,PHPStorm将打开phpunit文件,并告诉我这是它所在的行。 如果我单击continue,它将永远不会到达单元测试中的断点;我百分之百肯定它被击中了

我已将以下内容添加到我的:/etc/php5/cli/php.ini中

xdebug.remote_enable=1
xdebug.remote_port=9020
xdebug.idekey=PHPSTORM
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_connect_back=1
xdebug.remote_autostart=1
xdebug.extend_info=1
xdebug.show_local_vars=1
xdebug.remote_host=x.x.x.x
我使用以下命令运行测试:

function debugTest() {
   php -d xdebug.remote_enable=1 `which phpunit` `pwd`/$1
}
$debugTest myclassTest.php


老实说,我不确定从我的PHPStorm设置中分享什么会有帮助,但如果有什么会有帮助,我可以将其发送出去。

有几种方法可以改进测试执行:

  • 如果是虚拟机开发人员设置,请使用“PHPUnit”或“PHPUnit on Server”调试配置
  • 使用SSH上的调试
  • 在本地目录中提取PHPUnit文件

你的解决方案是什么?

不知道你为什么需要那种
debugTest
的东西。无论如何:您是否尝试过通过SSH进行调试?官方手册:有同样的问题!我忘了我有这个问题。我确实弄明白了,所以我得花点时间把我所做的写出来。其实没什么大不了的。