Behat

Good to know

Training goal

The participants will practice Behavior Driven Development (BDD) with Behat. Participants will learn how to write good user stories, meaningful tests and Behat features

Detailed contents

The training is regularly updated to be consistent with the latest version of Behat.

The training material is a web application project that will be developed by each participant. Hands-on work takes place throughout the training, so that participants progressively learn how to correct their mistakes.

The emphasis is on good practices.

Course materials provided

The trainer will distribute the training materials in electronic format at the end of the training.

In addition, the work done during these 2 days will result in the creation of a step-by-step versioned web application. Each participant is invited to keep on their machine the code of the training project, which they will have written themselves with the help of the trainer, because this code can be used as a technical base for future projects.

Prerequisites

To obtain the best learning experience, the participants must have some professional experience in the following:

  • object-oriented PHP development
  • use of a relational database
  • Knowledge of Git is a plus

Participants must have a computer to be able to do all the practical exercises along the training, operating on Linux (choice of distro is free), including preferably the following elements:

  • An internet connection allowing the installation of PHP extensions and packages from packagist and working with ease (if the training is held outside our premises),
  • An IDE they master (PHPStorm, SublimeText, VSCode, ...),
  • A UNIX shell,
  • A currently supported version of PHP (https://www.php.net/supported-versions.php),
  • Git installed (useful for composer dependencies),
  • One MySql/MariaDB server per person,
  • Administrator rights on the machine,

It is recommended for the participants to use a text editor they are comfortable with, so that they can focus on the training. Installing Symfony before the training is not necessary, participants will install it with the trainer during the training.

If the training is held in the Client's premises, we require for the Client to provide a separate room for the training to take place, big enough to accommodate all participants and the trainer, for the whole duration of the training. A video projector or wide screen TV must be provided so that the participants can see the trainer's laptop computer screen. A paperboard or white board would be much appreciated.

Training course

  1. Why BDD ?

    1. Introduction to the Behavior Driven Development

    2. Evolution of test-driven development

  2. Story BDD

    1. User stories

    2. Fixing communication

  3. Gherkin

    1. Feature templates

  4. Behat

    1. Testing with Gherkin

    2. FeatureContext

    3. Step definitions

    4. Assertion library

    5. File & Directory scenario

    6. Background

    7. Scenario Outline

    8. Tables

  5. Mink

    1. How to install Mink

      1. Drivers

      2. Initialize Goutte Driver

    2. Session

    3. Page

    4. Selectors

    5. Element

    6. Behat + Mink

      1. Bundled Definitions

      2. Scenario examples

    7. Configuration profiles

    8. Hide implementation details

  6. Practical Work

    1. Test sample

They recommend our trainings