PhpStorm中的phpunit错误 [英] Phpunit error in PhpStorm
问题描述
我正在PhpStorm中运行测试,但出现此错误.有谁知道到底是什么原因造成的?
I am running tests in PhpStorm and I get this error. Does anyone know what on earth could be causing it?
PHP致命错误:找不到类"PHPUnit_TextUI_ResultPrinter" 第249行的C:\ Users \ administrator1 \ AppData \ Local \ Temp \ ide-phpunit.php
PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\administrator1\AppData\Local\Temp\ide-phpunit.php on line 249
我在其他项目中运行测试-也使用ide-phpunit.php
,它们运行得很好.
I run tests in other projects - that also utilise ide-phpunit.php
and they run just fine.
推荐答案
我犯了一些严重的错误...只是忘了添加phpunit作为项目中的依赖项.对于遇到此错误的其他人,可以在composer.json中添加:
Silly mistake on my part... simply forgot to add phpunit as a dependency in the project. For anyone else that gets this error, to composer.json add:
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
然后运行:
composer update
那解决了这个问题.
这篇关于PhpStorm中的phpunit错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!