Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phpunit error in PhpStorm

I am running tests in PhpStorm and I get this error. Does anyone know what on earth could be causing it?

PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\administrator1\AppData\Local\Temp\ide-phpunit.php on line 249

I run tests in other projects - that also utilise ide-phpunit.php and they run just fine.

like image 354
b85411 Avatar asked Jul 22 '15 08:07

b85411


People also ask

How to start PHPUnit?

PHPUnit InstallationThe first command creates a folder in your current directory, test-project and the second command moves into it. The last command starts an interactive shell. Follow the prompt, filling in the details as required (the default values are fine).

How do I know if PHPUnit is installed on Windows?

To verify PHPUnit has been installed type phpunit --version in command prompt. You should get something like PHPUnit x.y.z by Sebastian Bergmann and contributors .


1 Answers

I had the same issue with Ubuntu 16.10, phpStorm 2017.2 and Laravel 5.5

Fixed it by uninstalling phpunit from my Ubuntu-system with

sudo apt-get remove phpunit sudo apt-get install --autoremove 

or for mac:

brew uninstall phpunit brew install phpunit 

My PhpStorm configuration (File -> Settings -> Languages & Frameworks -> PHP -> Test Frameworks):

phpStorm-Configuration

Works great, now!

like image 71
suud Avatar answered Sep 22 '22 11:09

suud