CakePHP Test Fixture Factories
summary
Provides a concrete replacement for SQL dumps: CakePHP Fixture Factories generate users/groups/permissions and their pivot rows on demand (five tables in the example) with default templates and an association builder, letting tests create entities without persistence or persist when needed. Adds a trigger-based PHPUnit test listener that records dirty tables in a tiny collector table and truncates only those tables, eliminating warm-up migrations and cutting suite time dramatically (red/blue/upper performance curves shown); packaged and in CakePHP docs.
AI-written summary · about
chapters (9)
- 0:00Intro
- 2:24TESTS AND THE DB
- 3:58TESTS SHOULD BE
- 5:43TEST ANATOMY
- 9:19CAKEPHP'S NATIVE ORM
- 12:25TEST FIXTURES
- 16:44CAKEPHP FIXTURE FACTORIES
- 23:20PERSIST COSTS
- 29:47DB CLEANING WITH TRIGGERS
related talks
16mSupercharge your Tests with Factories
25mTest automation patterns – not only Page Object
24mHow to build a test suite from scratch
40mMy Symfony functional testing toolbox
52mLaravel Testing Tips, Techniques and Pitfalls
36mPassbolt's Bread and Butter
23mCreating data for Functional Tests with the Test Data Builder Pattern
47mManaging Testing Data
