Mocks Aren't Stubs, Fakes, Dummies or Spies
summary
Describes clear, actionable distinctions: dummy fake stub mock spy with when to use each, and why mocks verify indirect outputs while spies only observe them; shows tools and examples using PHPUnit, Prophecy, Mockery, php-vcr and an in‑memory SQLite fake DB; reports a home‑grown fake Recurly web service that runs tests reliably for two years; warns that over‑specification (one example has 16 mocks and 18 expectations) makes tests brittle and recommends mocking only owned interfaces.
AI-written summary · about
