PHPackages                             dereuromark/cakephp-fixture-factories - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. dereuromark/cakephp-fixture-factories

ActiveCakephp-plugin[CLI &amp; Console](/categories/cli)

dereuromark/cakephp-fixture-factories
=====================================

A CakePHP plugin for creating test fixtures dynamically with factory pattern

1.3.1(2mo ago)17.9k↑46.8%1[1 issues](https://github.com/dereuromark/cakephp-fixture-factories/issues)MITPHPPHP &gt;=8.2CI passing

Since Aug 19Pushed 2mo agoCompare

[ Source](https://github.com/dereuromark/cakephp-fixture-factories)[ Packagist](https://packagist.org/packages/dereuromark/cakephp-fixture-factories)[ RSS](/packages/dereuromark-cakephp-fixture-factories/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (22)Versions (13)Used By (0)

 [![ff-logo](https://camo.githubusercontent.com/758490ab5327331f87be38438dc140bcc1dfb6dc1edd6c5baf7b0eb060976333/68747470733a2f2f7669657267652d6e6f6972652e6769746875622e696f2f696d616765732f666978747572655f666163746f726965732e737667)](https://vierge-noire.github.io/)

CakePHP Fixture Factories
==========================

[](#cakephp-fixture-factories)

### Write and run your tests faster. On any PHP application.

[](#write-and-run-your-tests-faster-on-any-php-application)

 [![Build Status](https://github.com/dereuromark/cakephp-fixture-factories/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/dereuromark/cakephp-fixture-factories/actions/workflows/ci.yml?query=branch%3Amain) [![Coverage Status](https://camo.githubusercontent.com/007c4b651e099f728f43634c85775299fb7375e74565ce99ca3894f64f0c4098/68747470733a2f2f636f6465636f762e696f2f67682f6465726575726f6d61726b2f63616b657068702d666978747572652d666163746f726965732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/dereuromark/cakephp-fixture-factories) [![Latest Stable Version](https://camo.githubusercontent.com/d2ddff7ea480aa00188a32aec4959ea8261808a8fe9055a890b54acdcd0bc028/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d666978747572652d666163746f726965732f762f737461626c652e737667)](https://packagist.org/packages/dereuromark/cakephp-fixture-factories) [![Minimum PHP Version](https://camo.githubusercontent.com/ec21f169d70b69344c67d6f18fa1a24d20476d2f0cd680e8c4a1534c22f34e5f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d3838393242462e737667)](https://php.net/) [![PHPStan Level 8](https://camo.githubusercontent.com/d117944b58da8146f96b4ef7403807610a20eeb3fbcaaaf95157bbcdad1686eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e737667)](https://phpstan.org/) [![License](https://camo.githubusercontent.com/1ceecabd11ec2857b49524eb50e45bb92009b83fe390e8d78d3ee75576aaf535/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d666978747572652d666163746f726965732f6c6963656e73652e737667)](LICENSE) [![Total Downloads](https://camo.githubusercontent.com/73e7a38883a2ef83ec859cdd8c9ef7714c8ee6f0e323662220f5c49b36834ae6/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d666978747572652d666163746f726965732f642f746f74616c2e737667)](https://packagist.org/packages/dereuromark/cakephp-fixture-factories)

Note: This is a maintained fork of the original [CakePHPFixtureFactories](https://github.com/vierge-noire/cakephp-fixture-factories).

Main differences:

- Supports multiple generators via adapters (chose your generator library).
- Modern configurable generator type guessing per field name/type when baking.

### Migrating from vierge-noire/cakephp-fixture-factories

[](#migrating-from-vierge-noirecakephp-fixture-factories)

If you're upgrading from `vierge-noire/cakephp-fixture-factories:^3.0`, the main breaking change is the generator type. Callbacks in `setDefaultTemplate()` now receive `GeneratorInterface` instead of `Faker\Generator`:

```
- use Faker\Generator;
+ use CakephpFixtureFactories\Generator\GeneratorInterface;

  protected function setDefaultTemplate(): void
  {
-     $this->setDefaultData(function (Generator $faker) {
+     $this->setDefaultData(function (GeneratorInterface $generator) {
          return [
-             'email' => $faker->email,
+             'email' => $generator->email(),
          ];
      });
  }
```

Key changes:

- Replace `Faker\Generator` type hints with `GeneratorInterface`
- Use `$this->getGenerator()` instead of deprecated `$this->getFaker()`
- Prefer method calls `->email()` over property access `->email` (both work)

See [Generator Differences](docs/generator-differences.md) for details on the abstraction layer.

---

```
ArticleFactory::make(5)
    ->with('Authors[3].Address.City.Country')
    ->persist();
```

---

Installation
------------

[](#installation)

```
composer require --dev dereuromark/cakephp-fixture-factories

```

Content
-------

[](#content)

- ### [Setup - DB Cleaning](docs/setup.md)

    [](#setup---db-cleaning)
- ### [Fixture Factories](docs/factories.md)

    [](#fixture-factories)
- ### [Test Fixtures](docs/examples.md)

    [](#test-fixtures)
- ### [Associations](docs/associations.md)

    [](#associations)
- ### [Associations for non-CakePHP apps](docs/no_cake_associations.md)

    [](#associations-for-non-cakephp-apps)
- ### [Scenarios](docs/scenarios.md)

    [](#scenarios)
- ### [Queries](docs/queries.md)

    [](#queries)
- ### [Bake command](docs/bake.md)

    [](#bake-command)
- ### [Persist command](docs/commands.md)

    [](#persist-command)
- ### [Generator Abstraction](docs/generator-differences.md)

    [](#generator-abstraction)
- ### [Configuration Reference](config/app.example.php)

    [](#configuration-reference)

---

Resources
---------

[](#resources)

[CakeFest 2021](https://www.youtube.com/watch?v=1WrWH2F_hWE) - [IPC-Berlin 2020](https://www.youtube.com/watch?v=yJ6EqAE2NEs) - [CakeFest 2020](https://www.youtube.com/watch?v=PNA1Ck2-nVc&t=30s)

Contribute
----------

[](#contribute)

Send PRs or tickets in GitHub.

Authors
-------

[](#authors)

Previously, Juan Pablo Ramirez and Nicolas Masson. This fork is maintained by Mark Scherer (dereuromark)

License
-------

[](#license)

The CakePHPFixtureFactories plugin is offered under an [MIT license](https://opensource.org/licenses/mit-license.php).

Copyright 2023 Juan Pablo Ramirez and Nicolas Masson

Licensed under The MIT License Redistributions of files must retain the above copyright notice.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance67

Regular maintenance activity

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

10

Last Release

71d ago

Major Versions

0.1.3 → 1.0.02025-11-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39854?v=4)[Mark Scherer](/maintainers/dereuromark)[@dereuromark](https://github.com/dereuromark)

---

Top Contributors

[![pabloelcolombiano](https://avatars.githubusercontent.com/u/23249541?v=4)](https://github.com/pabloelcolombiano "pabloelcolombiano (452 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (88 commits)")[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (17 commits)")[![ishanvyas22](https://avatars.githubusercontent.com/u/17404636?v=4)](https://github.com/ishanvyas22 "ishanvyas22 (9 commits)")[![ckbx-cakebox](https://avatars.githubusercontent.com/u/21092903?v=4)](https://github.com/ckbx-cakebox "ckbx-cakebox (5 commits)")[![liqueurdetoile](https://avatars.githubusercontent.com/u/28799444?v=4)](https://github.com/liqueurdetoile "liqueurdetoile (5 commits)")[![jsm222](https://avatars.githubusercontent.com/u/4705090?v=4)](https://github.com/jsm222 "jsm222 (4 commits)")[![dreamingmind](https://avatars.githubusercontent.com/u/1307216?v=4)](https://github.com/dreamingmind "dreamingmind (4 commits)")[![Erwane](https://avatars.githubusercontent.com/u/712604?v=4)](https://github.com/Erwane "Erwane (1 commits)")[![mbamarante](https://avatars.githubusercontent.com/u/409833?v=4)](https://github.com/mbamarante "mbamarante (1 commits)")[![MolbioUnige](https://avatars.githubusercontent.com/u/27211819?v=4)](https://github.com/MolbioUnige "MolbioUnige (1 commits)")[![o0h](https://avatars.githubusercontent.com/u/907122?v=4)](https://github.com/o0h "o0h (1 commits)")[![jamisonbryant](https://avatars.githubusercontent.com/u/6774110?v=4)](https://github.com/jamisonbryant "jamisonbryant (1 commits)")

---

Tags

clidevfixturescakephptestsdynamic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dereuromark-cakephp-fixture-factories/health.svg)

```
[![Health](https://phpackages.com/badges/dereuromark-cakephp-fixture-factories/health.svg)](https://phpackages.com/packages/dereuromark-cakephp-fixture-factories)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1862.1M27](/packages/dereuromark-cakephp-ide-helper)[vierge-noire/cakephp-fixture-factories

CakePHP Dynamic Fixtures

84858.8k9](/packages/vierge-noire-cakephp-fixture-factories)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)[buggregator/trap

A simple and powerful tool for debugging PHP applications.

2591.7M40](/packages/buggregator-trap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
