Building a Pyramid: Symfony Testing Strategies
summary
Argues for a strict testing pyramid: thousands of unit tests (run in seconds), a moderate number of service layer acceptance tests (run in minutes), and only a handful of slow, brittle UI tests. Shows Symfony examples: a controller-heavy basket refactored into a testable service; use of PHPUnit, PHPSpec, Behat/Codeception and Ghost Inspector; introduces a FileStore interface and an integration test after a unit test falsely passed because a required finalize upload call was missing.
AI-written summary · about
chapters (20)
- 0:00Introduction and speaker
- 0:46Why automate testing
- 2:12Choosing testing tools
- 4:01The testing pyramid explained
- 6:50UI layer testing
- 8:14Service layer testing
- 8:55Unit testing fundamentals
- 12:27Regression vs acceptance tests
- 13:51Legacy code testing example
- 18:05Writing acceptance tests
- 21:36Customer conversation in testing
- 23:46Service-level acceptance tests
- 26:11Reducing UI test coverage
- 28:00Acceptance test key principles
- 28:43Unit tests first approach
- 30:10PHPUnit vs PHPSpec for unit tests
- 32:20Testing infrastructure interactions
- 36:38Layered architecture benefits
- 41:15Building the testing pyramid
- 43:24Q&A session
