沃梦达 / 编程问答 / php问题 / 正文

phpstormphpunit

phpstorm amp; phpunit(phpstormphpunit)

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

问题描述

我创建了一个 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.

似乎 phpunit 没有在 phpstorm 中执行?不应该有某种错误消息而不是用退出代码0完成吗?php & 的路径phpstorms 配置中的 phpunit(相同)应该没问题(都通过 homebrew 安装在/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.4 php 5.3.14 PHPUnit 3.6.11

感谢您帮助我!
马蒂亚斯

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).

这篇关于phpstormphpunit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:phpstormphpunit

基础教程推荐