简体   繁体   English

将PHPUnit与PhpStorm集成出错

[英]Integrate PHPUnit with PhpStorm got error

I'm trying to set up my project with PHPUnit. 我正在尝试使用PHPUnit设置我的项目。 I tried to configure PHPUnit with my project on PhpStorm following steps explained on this article. 我尝试按照本文介绍的步骤在PhpStorm上的项目中配置PHPUnit。

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

But when I try to run tests I continuously getting following error. 但是,当我尝试运行测试时,我不断收到以下错误。

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

I tried setting up number of new projects and in all the cases I get this stupid error. 我尝试设置新项目的数量,并且在所有情况下都遇到了这个愚蠢的错误。 I don't know how to fix this. 我不知道该如何解决。 Please, your help is highly appreciated. 拜托,我们非常感谢您的帮助。

It seems that you are using PHPUnit through your IDE, and that the IDE has not provided PHPUnit with the correct include path items. 似乎您正在通过IDE使用PHPUnit,并且IDE尚未为PHPUnit提供正确的包含路径项。

To understand about include path, and what is happening in your problem, see this post , part on inclusions by relative or absolute path and the include path. 要了解有关include路径以及问题中发生的情况,请参阅这篇文章 ,按相对或绝对路径以及include路径部分地包含。

To solve your problem, you will need to change a setting in your IDE, either to include the PHPUnit library in the general include path of running PHP, or in the include path of running PHPUnit. 为了解决您的问题,您将需要在IDE中更改设置,或者将PHPUnit库包含在运行PHP的常规include路径中,或者将其包含在运行PHPUnit的include路径中。

It was version mis-match. 版本不匹配。 I tried to integrate PHPUnit 5.3+ with PHPstorm 8.+ version. 我试图将PHPUnit 5.3+与PHPstorm 8. +版本集成。 When I try PHPUnit 5.3+ with PHPStorm 2016.1 it worked as a charm. 当我在PHPStorm 2016.1中尝试使用PHPUnit 5.3+时,它起了很大的作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM