簡體   English   中英

phpstorm和phpunit

[英]phpstorm & phpunit

我創建了一個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? 在phpstorms配置中php和phpunit(相同)的路徑應該沒問題(都通過homebrew安裝在/ usr / local / bin中,路徑添加到phpstorm)

osx 10.7.4 php 5.3.14 PHPUnit 3.6.11

謝謝你的幫助!
馬蒂亞斯

在Mac OS X上,終端和正常應用程序中可用的環境變量可能不同, 請檢查解決方案的相關問題如何使它們相似。

請注意,此解決方案不適用於Mountain Lion (10.8)。

你在php.ini中編輯include_path嗎?

我有類似的情況。在我添加了梨的包含路徑后,它有效。

看這個。

在MacOSX上,我一直在努力解決simialair問題。

在我的情況下,原因是一個PHP升級腳本,它已經搞砸了一些權限。

我做了什么:

  • 確保我有權在pear bin_dir和php_dir中使用我自己的帳戶閱讀和執行
  • 確保php_dir位於include_path中

要查找這些目錄,您可以發布

# pear config-show

(查找bin_dir和php_dir)

這意味着我會做命令:

# (sudo) chmod -R 755 <bin_dir>
# (sudo) chmod -R 755 <php_dir>

更多編碼 - 更少的IDE配置!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM