I recently came across similar error PHPUnit_TextUI_ResultPrinter not found in TeamCity.php on line 19
I am using PhpStorm 2018.3.3
. Upon using terminal from PhpStorm
$ phpunit
PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
from my Ubuntu system
$ phpunit --version
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.
I had to make sure the my Ubuntu system PHPUnit is updated to 7.5.1. So here's what I did:
sudo wget https://phar.phpunit.de/phpunit-7.5.1.phar
sudo chmod +x phpunit-7.5.1.phar
sudo mv phpunit-7.5.1.phar /usr/local/bin/phpunit
Then I went to PhpStorm:
File > Settings > Language & Frameworks > PHP > Test Frameworks and made sure that the PHPUnit version is also 7.5.1
And then from PhpStorm terminal: phpunit
and the test cases were running perfectly fine.