 [ ← blog / phpstorm ](/) Apr 27, 2018  ·  \#phpstorm  ·  2 min read 

# PhpStorm: PHP Fatal error: Class 'PHPUnit\_TextUI\_ResultPrinter'

Recently I ran a good ole composer update on a client project. This updated Drupal and PHPUnit. I ran our PHPUnit tests via PhpStorm and ran into an odd error. Here's how I quickly fixed it!



Recently I ran a good ole **composer update** on a client project. This updated Drupal and PHPUnit. I ran our PHPUnit tests via PhpStorm and ran into an odd error:

```bash
Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in /private/var/folders/dk/1zgcm66d4vqchm8x5w4q57z40000gn/T/ide-phpunit.php on line 253
Call Stack:
    0.0019     446752   1. {main}() /private/var/folders/dk/1zgcm66d4vqchm8x5w4q57z40000gn/T/ide-phpunit.php:0
PHP Fatal error:  Class 'PHPUnit_TextUI_ResultPrinter' not found in /private/var/folders/dk/1zgcm66d4vqchm8x5w4q57z40000gn/T/ide-phpunit.php on line 253
PHP Stack trace:
PHP   1. {main}() /private/var/folders/dk/1zgcm66d4vqchm8x5w4q57z40000gn/T/ide-phpunit.php:0
```

If you didn't know, PhpStorm creates an ide-phpunit.php script that it invokes. Depending on the PHPUnit version it will generate the required code. In my case, it generated for 4.8.36

```php
//load custom implementation of the PHPUnit_TextUI_ResultPrinter
class IDE_Base_PHPUnit_TextUI_ResultPrinter extends PHPUnit_TextUI_ResultPrinter
{
    /**
     * @param PHPUnit_Util_Printer $printer
     */
    function __construct($printer, $out)
    {
        parent::__construct($out);
        if (!is_null($printer) && $printer instanceof PHPUnit_TextUI_ResultPrinter) {
            $this->out = $printer->out;
            $this->outTarget = $printer->outTarget;
        }
    }
    protected function writeProgress($progress)
    {
        //ignore
    }
}
```

The quick fix: Let PhpStorm know that the PHPUnit version was updated. The error comes from the scripts PhpStorm generates for running PHPUnit. Once I clicked the refresh button, PHPUnit was recognized as 6.5.8, and the error was resolved.

     ![](/sites/default/files/styles/large/public/Preferences.png?itok=7Ld_ATaH) 

  

  ![](/themes/custom/mglaman/images/headshot.webp)Thanks for reading

I write about Drupal, PHP, and the quiet infrastructure behind large sites — caching, config, and testing. New posts land every week or two.

 [Subscribe via RSS →](/rss.xml) [About me →](/about-me) 

 



 

  [← Older

Enabling RESTful web service interfaces in Drupal 8

 ](/blog/enabling-restful-web-service-interfaces-drupal-8) [Newer →

Using Drupal Console to manage your RESTful endpoints

 ](/blog/using-drupal-console-manage-your-restful-endpoints)