Behat Version: Not installed (Composer, Windows)


I'm having problems with configuring Behat in PHP Storm. This is my first project to use Behat and I've already successfully used it via command line, as you can see here:

After that I wanted to configure it in PHP Storm. This is what the config looks like:

However, this is what I get when I click the "Reload phpinfo" button (the refresh icon):

Somehow getcwd() command executed in ApplicationFactory.php of Behat returns System32 folder when executed from PHP Storm, while command line gives the correct directory. I don't understand what could cause this and being at my wits end I decided to post here for assistance.

Comment actions Permalink

Please check if you have anything suspicious added to PHP Include at Settings | Languages & Frameworks | PHP.
Also, would it happen if you create a new project and install Behat there?

Comment actions Permalink

Hello Eugene,


Include Path has all entries within the project's folder. The location behat files are attempted to be loaded from has changed today to PhpStorm's install folder: C:\Program Files\JetBrains\PhpStorm 2018.1\bin\


After another restart of the app it was back in C:\Windows\System32.

I have also tried a completely blank project and had the same problem. Literally created a project with:
composer create-project symfony/website-skeleton testproj
Added "behat/behat": "^3.4" to require-dev, did composer install and update, went into Settings > Language & Frameworks > PHP, set interpreter, proceeded to Test Frameworks and was faced with exactly the same problem.

Comment actions Permalink

For anyone having similar problems - anything that will be printed out when executing the Behat command to get its version (required for IDE to properly configure it) will interfere with that process breaking it, so please make sure if there is no additional output (like the system file errors visible above, or any echo in bootstrap file, or anything similar).


Please sign in to leave a comment.