~/talk

"Testing with Doubles: Why, When, and How?"

Talkat TYPO3 Developer Days 2024 · 2024-08-01..08-03· [testing]
slides:none on file

Demonstrates how PHPUnit dynamically builds createStub and createMock objects to replace interfaces or non‑final classes, configure behavior with willReturn / willThrowException, and set call expectations like once, never or exactly(n). Shows a concrete SellGood command processor test using a MarketSourcer stub and a handwritten spy for event writing, explains automatic minimal return‑value generation, warns that final/value objects can’t be doubled, and recommends adapters so as to not mock what you do not own.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07Why test doubles matter
  3. 6:54Test doubles explained
  4. 13:02Test stubs in practice
  5. 18:21Mock objects deep dive
  6. 22:57PHPUnit API for doubles
  7. 27:11What can and cannot be doubled
  8. 36:43When to use each type
  9. 40:58Company and resources
  10. 42:13Q&A
~/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.