dereuromark / cakephp-fixture-factories
A CakePHP plugin for creating test fixtures dynamically with factory pattern
Package info
github.com/dereuromark/cakephp-fixture-factories
Type:cakephp-plugin
pkg:composer/dereuromark/cakephp-fixture-factories
Requires
- php: >=8.2
- cakephp/orm: ^5.0
Requires (Dev)
- cakephp/bake: ^3.0.0
- cakephp/migrations: ^4.7.0 || ^5.0.0
- cakephp/twig-view: ^2.0.2
- dereuromark/cakephp-ide-helper: ^2.17
- fakerphp/faker: ^1.23
- johnykvsky/dummygenerator: ^0.2.1
- josegonzalez/dotenv: ^4.0.0
- php-collective/code-sniffer: dev-master
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5 || ^12.1 || ^13.0
- rector/rector: ^2.1
- vierge-noire/cakephp-test-suite-light: ^3.0
Suggests
- dereuromark/cakephp-ide-helper: Lets `bin/cake annotate classes` (and `annotate all`) keep your Factory subclass docblocks in sync via the bundled FactoryAnnotatorTask. Requires version with PathAwareClassAnnotatorTaskInterface support.
- dev-main
- 2.0.0-rc.1
- 2.0.0-beta.3
- 2.0.0-beta.2
- 2.0.0-beta.1
- 1.x-dev
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-feature/detect-fk-in-definition
- dev-docs/upgrade-notes-since-beta-3
- dev-feature/for-has-alias-overload
- dev-feature/sequence-object
- dev-feature/bake-all-fields
- dev-feature/table-assertions-trait
- dev-feature/story-pool-pattern
- dev-feature/phpunit-13-mock-notices
- dev-feature/recycle-shared-parent
This package is auto-updated.
Last update: 2026-05-14 10:40:30 UTC
README
CakePHP Fixture Factories
Write and run your tests faster. On any PHP application.
This branch is for CakePHP 5.0+. See version map for details.
A maintained fork of vierge-noire/cakephp-fixture-factories with:
- Multiple data generators via adapters (Faker, DummyGenerator, custom).
- Modern configurable generator type guessing per field name/type when baking.
📚 Documentation
👉 dereuromark.github.io/cakephp-fixture-factories
The full guide, reference, and migration notes live there.
Installation
composer require --dev dereuromark/cakephp-fixture-factories
Quick Example
ArticleFactory::new() ->count(5) ->with('Authors[3].Address.City.Country') ->saveMany();
Five articles, each with three authors, each with an address chain — persisted, in one expression.
See Getting Started for the full walkthrough.
Resources
CakeFest 2021 - IPC-Berlin 2020 - CakeFest 2020
Contribute
Send PRs or tickets in GitHub.
Authors
Previously, Juan Pablo Ramirez and Nicolas Masson. This fork is maintained by Mark Scherer (dereuromark).
License
The CakePHPFixtureFactories plugin is offered under an MIT license.
Copyright 2023 Juan Pablo Ramirez and Nicolas Masson.
Licensed under The MIT License. Redistributions of files must retain the above copyright notice.