~/talk

From Betamax to VCR: harden your API integration testing

Talkat PHP UK Conference 2022 · 2022-02-16..02-18· [testing, developer-experience]
slides:none on file

Mocking hand‑written JSON fixtures causes silent false positives when the external API quietly changes; the practical fix shown is PHP-VCR which records real HTTP traffic (cURL/stream/SOAP) into cassette files (YAML/JSON/XML) and replays it in record/playback modes. An integration is built as a Pest trait that records integration tests once, speeds CI and enables offline dev — it works in practice but costs include credential handling, cassette naming, staging access and maintenance of an OSS recorder.

AI-written summary · about

  1. 0:00Introduction
  2. 0:55About me
  3. 2:33Outline
  4. 3:55Betamax vs VCR
  5. 5:11The most practical solution
  6. 7:38People do this
  7. 11:37My problem
  8. 13:58How does VCR work
  9. 15:02How does VCR look
  10. 18:53Using VCR
  11. 19:36VCR examples
  12. 21:05Pros and cons
  13. 22:13Documentation
  14. 24:43External API
  15. 25:59Example
  16. 28:07Thoughts
  17. 29:07Staging environments
  18. 30:38Naming APIs
  19. 31:49Open Source
  20. 33:50Conclusion
  21. 36:06Questions
~/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.