Behat Best Practices
summary
Argues that the best practice is to do BDD with Behat and to drive the domain model directly for fast, descriptive acceptance tests; shows a concrete feature (course proposed with class size 2–3) with three scenarios and implements Course, Learner and ClassSize value objects until tests go green. Recommends a service layer tested via a Symfony/PSR-11 extension, using Mink + Selenium or Chrome headless for UI, and use in-memory repositories to keep acceptance suites fast and reliable.
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker setup
- 1:02What is BDD and Behat
- 3:13Business problems to software solutions
- 8:40Behavior and examples in BDD
- 15:17BDD beyond testing
- 18:07Introducing Behat and Gherkin
- 22:05Automating domain model tests
- 33:29Ubiquitous language in domain models
- 33:49Testing service layer with Behat
- 41:44Fake infrastructure for fast tests
- 47:10UI testing pitfalls and alternatives
- 51:02Mink and browser automation
- 56:09Summary and closing remarks
