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