talira

Behaviour-driven development for PHP

open sourceMITfree

Behat is an open source behaviour-driven development tool for PHP, the PHP implementation of Cucumber: teams write specifications as features and scenarios in plain-language Gherkin, and Behat runs them against the application through PHP step definitions. Scenarios can drive anything, from a browser or HTTP API calls to shell commands, the database or PHP code directly, and profiles, tags and suites run the same features in different ways. It works with any PHP framework, uses Symfony components internally, and nearly every part can be extended or replaced through extensions (framework integrations, browser automation, reporters, fixtures). MIT licensed.

Problems it solves

  • write acceptance tests for my PHP app in plain English the product team can read
  • do behaviour-driven development in PHP
  • test my Symfony or Laravel app's features from the user's point of view
  • run the same acceptance scenarios against the API and through a browser
  • turn agreed requirements into executable specifications for a PHP project

Features

  • Gherkin features and scenarios in plain language
  • PHP step definitions, hooks and argument transformations
  • profiles, tags and suites to run the same features different ways
  • output formatters, including custom ones
  • extension system for framework integrations, browser automation, reporters and fixtures
  • works with any PHP framework, or none

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what Behat does.

  1. Cucumber Automated acceptance tests written in plain language
  2. phpspec Specification-oriented BDD framework for PHP
  3. Codeception Full-stack testing framework for PHP
  4. SymfonyExtension (Behat) Behat extension that runs your contexts as Symfony services and tests the app without a server

Compare Behat with the top 3