我创建了一个phpunit测试文件,当我尝试通过phpstorm运行它时,我收到消息:
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
当我通过命令行执行此操作时,我得到更多的输出
PHPUnit 3.6.11 by Sebastian Bergmann.
...etc...
FAILURES!
Tests: 2, Assertions: 2, Failures: 1.
似乎phpunit没有在phpstorm中执行?不应该有某种错误信息而不是退出代码0?
php&的路径在phpstorms配置中的phpunit(相同)应该没问题(都通过homebrew安装在/usr/local/bin中,路径添加到phpstorm)
osx 10.7.4
php 5.3.14
PHPUnit 3.6.11
谢谢你的帮助!
马蒂亚斯
解决方法:
在Mac OS X上,终端中可用的环境变量和正常应用程序可以不同,check the related question对于解决方案如何使它们相似.
注意这个解决方案will not work on Mountain Lion(10.8).