本文介绍了phpstorm& phpunit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个phpunit测试文件,当我尝试通过phpstorm运行它时,我收到消息:

I created a phpunit test file , when I try to run it via phpstorm, I get the message:

Unable to attach test reporter to test framework or test framework quit unexpectedly

似乎执行了以下命令:

 /usr/local/bin/php /private/var/folders/4b/qrnw7nbd6llgmhrss5rf1_880000gt/T/ide-phpunit.php  --configuration /Users/Shared/sites/pac/app/app/phpunit.xml.dist BackendControllerTest /Users/Shared/sites/pac/app/modules/Pac/Backend/Tests/Controller/BackendControllerTest.php
Testing started at 23:22 ...

Process finished with exit code 0

当我通过命令行执行此操作时,我会得到更多的输出

when i execute this via command line , i get much more output

PHPUnit 3.6.11 by Sebastian Bergmann.

...etc...

 FAILURES!
Tests: 2, Assertions: 2, Failures: 1.

似乎在phpstorm中未执行phpunit?应该没有某种错误消息,而不是以退出代码0结尾吗?php&的路径phpstorms配置中的phpunit(相同)应该可以(都通过/usr/local/bin中的自制程序安装,路径已添加到phpstorm中)

seems phpunit isn't executed in phpstorm? shouldn't there be some sort of error message instead of finishing with exit code 0?Paths to php & phpunit (same) in phpstorms configuration should be ok (both installed via homebrew in /usr/local/bin, path added to phpstorm)

osx 10.7.4PHP 5.3.14PHPUnit 3.6.11

osx 10.7.4php 5.3.14PHPUnit 3.6.11

感谢您的帮助!
马蒂亚斯(Matthias)

Thanks for helping me!
Matthias

推荐答案

在Mac OS X上,终端机中可用的环境变量和用于正常应用程序的环境变量可以不同,以获取如何使它们相似的解决方案.

On Mac OS X environment variables available in Terminal and for the normal applications can be different, check the related question for the solution how to make them similar.

请注意,此解决方案不适用于Mountain Lion (10.8).

Note that this solution will not work on Mountain Lion (10.8).

这篇关于phpstorm& phpunit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 08:01