Search code examples
phppluginsphpstormbehat

How to fix Class 'Behat\Behat\Output\Printer\ConsoleOutputPrinter' not found


Im trying to use the Behat plugin for PHPStorm (on Behat 3). the problem is once i try to run a feature i will receiving the following Fatal error:

Fatal error:  Class 'Behat\Behat\Output\Printer\ConsoleOutputPrinter' not found in /private/var/folders/js/27x3tw5n5jx9b14vn_cn12w0748zmg/T/ide-behat.php on line 82

I had a look in the Behat source i can see there is no such file, and instead we have "Behat\Behat\Output\Printer\ConsoleOutputFactory"

I did try to manually change the code in "ide-behat.php" but as sson as you run the test the file will be regenerated automatically

Any advise will be appreciated.

thanks


Solution

  • As it appears in Behat 3.0.x-dev the output printer is under changes and ConsoleOutputPrinter gives its place to ConsoleOutputFactory.

    So for the time being i solved my problem by switching to Behat 3.0.15 specifically.

    e.g. by changing dependency in composer.json from

    {
        "require": {
            "behat/behat": "3.0.x-dev"
        }
    }
    

    to

    {
        "require": {
            "behat/behat": "3.0.15"
        }
    }
    

    But still it will be interesting to learn more about ide-behat.php file and understand amend it, to be ready for the upcoming changes in new Behat.