CakePHP Fixture Factories 2.0 RC introduces a redesigned, immutable fluent API for factory-driven testing in CakePHP. Key changes include renamed terminal methods (build/save/saveMany replacing make/persist/getEntity), a new sequenceField() helper for cycling column values, directional for()/has() association helpers with explicit disambiguation, recycle() for sharing parent entities across association branches, a TableAssertionsTrait for database-state assertions, a Story class for named entity pools, and a pluggable generator backend supporting both FakerPHP and DummyGenerator with auto-detection. The package ships a Rector config to automate most call-site renames. FactoryTransactionStrategy eliminates the need for $fixtures arrays by wrapping each test in a rolled-back transaction.
Table of contents
TL;DRWhy we wanted to modernizeWhat v2 looks likeSharper static analysisDatabase-state assertionsNamed entity pools with StoryTest isolation without $fixtures arraysPluggable generator backendHow to upgradeWhat’s nextThanksLinksSort: