Objects, Testing and Responsibility
summary
Argues that clear object responsibilities and tests make PHP code debuggable and maintainable, demonstrates PHP features (namespaces, traits, late static binding) and test tools (PHPUnit, Composer, AspectMock for legacy), shows surprising API counts on Eloquent models: 126 public methods with 0 private, builds an Authority library wired to an event dispatcher and unit tests that verify behavior, recommends composition over inheritance and acceptance tests first when facing legacy code, and reports tests keep package quality high.
AI-written summary · about
chapters (5)
- 0:00Start
- 20:30EXAMPLE PLAIN CLASSES
- 24:24DESIGN PATTERNS
- 31:57COMPOSITION OVER INHERITANCE
- 38:57BASE TESTS OFF ACCEPTANCE CRITERIA
related talks
50mBuilding Testable PHP Applications
47mRight Approaches to Testing in PHP: Or How Quantity Can Break Quality
41mExtremely defensive PHP
45mTesting Legacy Code - What To Do When It Seems Untestable
41mTesting Legacy Code & Safe Refactoring
51mModern PHP
01h 00mPrinciples of Unit Testing
41mLiving the Best Life on a Legacy Project
