2013-08-19 09:15
浏览 430

在include path phpstorm中找不到PHPUnit

Cannot find PHPUnit in include path is the error message I get when I try to run my code in phpstorm.

In the PHP Settings, my PHP level language is 5.4 (traits, short array syntax, etc.) and interpreter is Name(5.4.7) where Name is user defined.

The error appears when I try to run the code and the exact message is this:

C:\xampp2\php\php.exe C:\Users\DELL\AppData\Local\Temp\ide-phpunit.php --no-configuration


Testing started at 2:34 PM ...

Process finished with exit code 1

Cannot find PHPUnit in include path (.;C:\xampp2\php\PEAR)`

图片转代码服务由CSDN问答提供 功能建议

在包含路径中找不到PHPUnit 是我尝试运行时收到的错误消息 我在phpstorm中的代码。

在PHP设置中,我的PHP级语言是 5.4(特征,短数组语法等),解释器是 名称(5.4.7)其中 Name 是用户定义的。

当我尝试运行代码时出现错误,确切的消息是这个 :

C:\ xampp2 \ php \ php.exe C:\ Users \ DELL \ AppData \ Local \ Temp \ ide-phpunit.php --no-configuration

C:\ xampp2 \ htdocs \ ft-website



在包含路径中找不到PHPUnit(。; C:\ xampp2 \ php \ PEAR)` \ n

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

6条回答 默认 最新

  • doutian3010 2014-03-25 20:11

    Just encountered this problem myself.

    I'm unsure why it is unable to find PHPUnit in the include path (despite the fact that it is there, albeit in all lowercase).

    I got around this by changing my IntelliJ Preferences for PHPUnit (under PHP --> PHPUnit). I changed the PHPUnit library settings to Use custom loader and then specified the path to the phpunit executable. On my mac, that was /usr/local/Cellar/php54/5.4.26/bin/phpunit.


    I just discovered that pear now installs PHPUnit as a phar named phpunit. It previously installed the PHPUnit source, which was really nice for reference and code completion in PHPStorm. I think that this is the reason things aren't working any longer with PHPStorm, because it's expecting a php executable and not a php archive.

    So, I'm moving away from using pear to install PHPUnit, and I'm using composer instead. This bundles PHPUnit directly as a dependency of my project, which makes it more portable than a system dependency. You'll need to add vendor/phpunit/phpunit as a PHP include path in your PHPStorm preferences. This will serve two purposes:

    1. PHPStorm can find the phpunit executable now
    2. PHPStorm will index all the PHPUnit classes now, so you'll get auto-complete. Yay!

    To do this, go to Languages and Frameworks in the PhpStorm settings. If you click on PHP, on the right you have your include paths

    解决 无用
    打赏 举报
  • 查看更多回答(5条)

相关推荐 更多相似问题