Code like a pro
summary
Live coding builds a tiny PHP domain: Sunbed, Towel, Guest classes plus a GuestId value object, with behavior for reserve/occupy, guard clauses and a TowelException when another guest tries to sit. Tests run with PHPUnit (red‑green‑refactor) and autoloading via phpab; tests are unit‑fast so you run them every minute. Demonstrates TDD workflow, immutable value objects, handling object identity (towel ownership), and a second lottery exercise set up for the afternoon.
AI-written summary · about
chapters (8)
- 0:00Introduction and setup
- 5:51Live coding begins with sunbeds
- 47:41Small objects and domain-driven design
- 1:00:02Value objects and immutability
- 1:10:28TDD principles and red-green-refactor
- 1:20:29Lottery example introduction
- 1:31:16TDD nutshell and exercise instructions
- 1:43:07Q&A and closing remarks
related talks
50mBuilding Testable PHP Applications
58mObjects, Testing and Responsibility
46mUnit Testing by Example
01h 05mLightning fast tests
49mTDD💙BDD💙PHP - Test-driven development in PHP with phpspec
36mAn Introduction to OOP, Design Patterns, and TDD
35mThe Absolute Beginner's Guide To Test-Driven Development
45mGetting started with test-driven development with PHPUnit
