X 在 Eclipse PDT 中调试 PHPUnit 测试用例
到目前为止,我一直在使用 vim 和适当的 script< 来调试 PHP 脚本和测试用例/a> 与 python 支持它。然而,我和我的同事需要前进,而 vim/gvim 不是他们的选择。
因此,我尝试在我的设置中集成调试 PHPUnit in Eclipse作为外部工具,它再次与 vim 一起使用。 ,它只是等待一些东西。
- 但是,当我启动新的外部工具,然后
- 作为 CLI 脚本开始调试时
远程调试已启用,环境变量 XDEBUG_CONFIG="idekey=ECLIPSE_DBGP_127.0.0.1" 也已设置。
有什么想法吗?
附录
运行测试套件有效。调试网页有效。调试给定测试则不然。
当尝试调试 phpunit 测试时,Eclipse 在 57% 处永远等待。我想提供更多信息,但它也没有告诉我更多信息。
Until now, I was debugging my PHP scripts and testcases using vim and the appropiate script with python backing it. However, me and my colleagues need to move forward and vim/gvim is not an option for them.
So I've tried to integrate debugging PHPUnit in Eclipse on my setup as an external tool, which again, works with vim. However, it simply waits for something when I
- Launch the new external tool, then
- start debugging as a CLI script
Remote debugging is enabled, the environment variable XDEBUG_CONFIG="idekey=ECLIPSE_DBGP_127.0.0.1" is also set.
Any ideas?
Addendum
Running the testsuite works. Debugging a web page works. Debugging a given test doesn't.
Eclipse waits forever for something at 57% when trying to debug a phpunit test. I'd like to provide more information, but it doesn't tell me more either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我写了一篇关于如何从 eclise pdt 启动 phpunit 单元测试的文章,不使用外部工具启动器,而是使用 phpunit.php 脚本本身,请看这里:
http://elespaciodejaime.wordpress.com/2010/04/19/ pruebas-unitarias-en-joomla-con-phpunit-y-soporte-para-debugging/
解释在最后,顺便说一下,它是西班牙语的。
I have wrote an article about how to get it done launching phpunit unit tests from eclise pdt not using the external tools launcher but the phpunit.php script itself, look here:
http://elespaciodejaime.wordpress.com/2010/04/19/pruebas-unitarias-en-joomla-con-phpunit-y-soporte-para-debugging/
the explanation is at the end, by the way, it is in spanish.
您可以在此处找到测试 Joomla 1.5 和 Joomla 3.x 组件的简单轻量级方法的教程和代码在 Github 上。您可以看到 Joomla 1.5 和 Joomla 3.x 下的测试之间发生了什么变化。这些示例基于使用随 Composer 安装的 PHPUnit + DBUnit,并在 Eclipse Luna for PHP Developer 中配置和运行强>(PDT)。
You find a tutorial and the code of a simple lightweight way of testing Joomla 1.5 and Joomla 3.x component here on Github. You can see what changed between testing under Joomla 1.5 and in Joomla 3.x. The examples are based on the use of PHPUnit + DBUnit installed with Composer and configured and run in Eclipse Luna for PHP Developer (PDT).
您可以通过进入 php 调试视角并从菜单中选择 run->debug->debug as php web page 或 debug php script 来启动调试会话。
如果您使用 zend studio,您可以作为 php 单元测试进行调试。
还有一个 firefox 扩展可以帮助使用 xdebug https://addons 进行调试。 mozilla.org/en-US/firefox/addon/3960
另外,请确保转到首选项面板并选择 php->debug->installed debuggers,然后单击 xdebug,然后单击配置。应该有一个允许传入连接的选项。选择它,您就可以从 Firefox 启动远程调试会话。
you can launch a debug session by going to the php debug perspective and select from the menu run->debug->debug as php web page or debug php script.
If you use zend studio you can debug as a php unit test.
There is also a firefox extension that helps with debugging with xdebug https://addons.mozilla.org/en-US/firefox/addon/3960
Also make sure go to preferences panel and select php->debug->installed debuggers and click on xdebug then click on configure. There should be an option to allow incoming connections. Select that and you can launch remote debug sessions from firefox.