Driving quality with PhpSpec
summary
PhpSpec is a class‑level SpecBDD tool that runs via Composer and Prophecy and pushes a strict TDD cycle: it auto‑generates classes, interfaces and constructors when a spec fails, it uses Prophecy for doubles and offers stubs or spies, and it can fake return values to get to green fast. It rejects testing private methods or databases, expects small iterative examples, emits readable spec documentation, and steers design toward interfaces and focused object collaboration.
AI-written summary · about
chapters (16)
- 0:00Introduction to PHPSpec
- 1:09BDD vs TDD explained
- 4:19Why BDD focuses on examples
- 7:31PHPUnit vs PHPSpec comparison
- 9:16PHPSpec’s design philosophy
- 13:53PHPSpec 2 rewrite and evolution
- 16:43Writing your first specification
- 21:19Implementing behavior step-by-step
- 27:52Testing object collaborations
- 34:13Designing interfaces with PHPSpec
- 36:19Integration with higher-level tests
- 41:15Stubs vs mocks in PHPSpec
- 48:22Building a domain model
- 51:08PHPSpec for legacy code
- 52:13Open-source project insights
- 54:58Q&A session
