【问题标题】:Integrate PHPUnit with PhpStorm got error将 PHPUnit 与 PhpStorm 集成时出错
【发布时间】:2016-09-12 02:36:07
【问题描述】:

我正在尝试使用 PHPUnit 设置我的项目。我尝试按照本文中解释的步骤在 PhpStorm 上使用我的项目配置 PHPUnit。

http://blog.jetbrains.com/webide/2013/03/phpunit-installation-via-composer-in-phpstorm/

但是当我尝试运行测试时,我不断收到以下错误。

Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in C:\Users\win 8\AppData\Local\Temp\ide-phpunit.php on line 49

Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.;C:\wamp\bin\php\php5.6.19\pear') in C:\Users\win 8\AppData\Local\Temp\ide-phpunit.php on line 49

Process finished with exit code 255

我尝试设置一些新项目,但在所有情况下,我都会遇到这个愚蠢的错误。我不知道如何解决这个问题。非常感谢您的帮助。

【问题讨论】:

标签: phpunit composer-php phpstorm


【解决方案1】:

这是版本不匹配。我尝试将 PHPUnit 5.3+ 与 PHPstorm 8.+ 版本集成。当我尝试使用 PHPStorm 2016.1 的 PHPUnit 5.3+ 时,它就像一个魅力。

【讨论】:

    【解决方案2】:

    您似乎是通过 IDE 使用 PHPUnit,并且 IDE 没有为 PHPUnit 提供正确的包含路径项。

    要了解包含路径以及您的问题发生了什么,请参阅this post,关于通过相对或绝对路径的包含以及包含路径的部分。

    要解决您的问题,您需要更改 IDE 中的设置,将 PHPUnit 库包含在运行 PHP 的一般包含路径中,或包含在运行 PHPUnit 的包含路径中。

    【讨论】:

      猜你喜欢
      • 2017-05-25
      • 2011-08-31
      • 2017-09-03
      • 2016-12-11
      • 2011-09-26
      • 2017-09-27
      • 2017-08-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多