~/talk

Better Testing in Laravel

Talkat Laracon EU Online 2021 · 2021-01-18..01-22· [php, testing]
slides:none on file

Advocates integration‑style tests over strict unit tests to maximize refactor confidence, trading some speed for readability over mock-heavy speedups. Recommends using a default payload and Laravel’s array_except helper plus data providers with generators and optional setup callbacks to cover required/invalid/unique validation cases without repetitive tests. Tests middleware by defining a dummy route inside the test, asserting behavior at the HTTP level, and using laravel test assertions to verify routes use the middleware while disabling it in route tests when setup is noisy.

AI-written summary · about

  1. 0:00Intro
  2. 3:59Fast tests
  3. 4:46Reduce unnecessary details
  4. 5:21Testing
  5. 8:20Strings
  6. 13:28Specific Values
  7. 14:19Validation
  8. 16:02Validation Provider
  9. 18:59Incorrect Values
  10. 20:37Unique Email
  11. 21:17Setup Step
  12. 22:45Testing Middleware
  13. 23:42Why not use a route
  14. 28:47Test assertions
  15. 30:19Test middleware
~/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.