TDD💙BDD💙PHP - Test-driven development in PHP with phpspec
summary
Demonstrates test-driven and behavior-driven development in PHP using phpspec: shows composer install, describe/run commands, automatic creation of classes and methods, and the red‑green‑refactor loop turning failing examples into passing code. Implements an end‑to‑end FizzBuzz kata, fixes a 20% test break caused by adding strict types, and shows interaction tests using Prophecy mocks and a logger while emphasizing readable specs, constructor injection, and incremental refactors with tests passing at each step.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 4:07Automated testing in PHP
- 6:15TDD and Red-Green-Refactor
- 9:48BDD and stakeholder communication
- 12:40phpspec for BDD in PHP
- 13:44Installing phpspec
- 16:52Writing first spec
- 21:52Test-driven FizzBuzz
- 26:32Refactoring and error handling
- 28:40Testing collaborators and mocks
- 32:36Common testing mistakes
- 33:43PHP Catania community resources
- 34:27Q&A
related talks
30mPHP: BDD revolution — how we returned from hell
26mBehaviour Driven Development with Laravel
45mGetting started with test-driven development with PHPUnit
50mBuilding Testable PHP Applications
40mBarely Enough Design
49mTesting for the Brave and True
02h 24mUsing Behat and PHPSpec for emergent design with ubiquitous language
56mUnit Testing by Example
