Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.



Behat is a BDD (behavior driven development) framework for PHP. This tutorial describes how to install, configure and use Behat right from the PhpStorm IDE. With BDD, you write human-readable stories that describe the behavior of your application. These stories can then be auto-tested against your application.

Table of Contents


To make use of Behat, we first have to install it on our system. Read more about Behat installation in official documentation.

Installing Behat via Composer

A Composer package for Behat is available. A dependency can be added to composer.json using Composer Support in PhpStorm (recommended) or manually.

Use the Composer | Add dependency... context menu on your project and install behat/behat package: Image Added

Installing Behat with Phar package

You can either download behat.phar package from Behat GitHub repository, or install it in Settings | PHP | Behat | Download behat.phar from... Image Added

Run Configuration for Behat

Behat Intellisense
1) Resolve from step in Gherkin file to Context file
2) Find Usages from Context file to usages in Gherking files
3) Keyword and step completion
4) Generation for undefined steps

Behat Intellisense

Resolve from step in Gherkin file to Context file

Find Usages from Context file to usages in Gherkin files

Keyword and step completion

Generation for undefined steps


<a href="" class="twitter-share-button" data-text="Using Behat in PhpStorm" data-count="horizontal" data-via="phpstorm" data-hashtags="">Tweet</a><script charset="local" type="text/javascript" src=""></script>
<span id="fb-root"></span><script charset="local" type="text/javascript" src=""></script><fb:like href="" send="false" layout="button_count" width="150" show_faces="false" style="position:relative;margin-left:-20px;top:-5px;"></fb:like>
<script type="text/javascript" src=""></script>
<g:plusone size="medium"></g:plusone>