Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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.

Error rendering macro 'toc' : [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "fb" at [row,col {unknown-source}]: [3,372]


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:

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...

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

  • No labels