~/talk

Testing API's written in PHP using the Behat feature testing tool

Talkat Dutch PHP Conference 2024 · 2024-03-12..03-15· [testing, php]
slides:none on file

Shows using Behat with the Mink extension and Symfony integration to write API end‑to‑end tests in Gherkin that call endpoints, assert JSON (use strict JSON Schema: required + additionalProperties false) and verify database effects by truncating tables via Doctrine before scenarios. Examples include delete‑task scenarios (owner vs other user), CI tag skipping for flaky third‑party calls, stop‑on‑failure workflow, and a tiny Symfony users+tasks demo on GitHub. Team reports bugs drop to almost negligible after adopting this setup.

AI-written summary · about

  1. 0:00Behat and API testing intro
  2. 1:54What is Behat
  3. 3:20Installing Behat
  4. 5:04Configuring Behat
  5. 5:25Gherkin syntax
  6. 7:13API tests with Gherkin
  7. 8:15Behat contexts
  8. 10:23Open-source Behat contexts
  9. 12:12Tagging tests
  10. 13:21Hooks for setup
  11. 15:49Backgrounds in tests
  12. 16:32Testing with outlines
  13. 18:20Running Behat CLI
  14. 19:24Formatting test output
  15. 19:46Validating JSON schemas
  16. 20:28HTTPS cert handling
  17. 21:09Behat for teamwork
  18. 22:34API testing benefits
  19. 24:00Behat in PHPStorm
  20. 25:27Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.