PHPackages                             elythyr/prooph-fixtures - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. elythyr/prooph-fixtures

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elythyr/prooph-fixtures
=======================

First attempt to make something similar to DoctrineFixtures with Prooph

v1.1(7y ago)01361MITPHP

Since Dec 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/elythyr/prooph-fixtures)[ Packagist](https://packagist.org/packages/elythyr/prooph-fixtures)[ RSS](/packages/elythyr-prooph-fixtures/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (6)Versions (3)Used By (1)

Prooph Fixtures
===============

[](#prooph-fixtures)

[![Build Status](https://camo.githubusercontent.com/4d1ed8ee8b05ab4d7a7c2f62540ed3da3caa618e704b1f73e5e7a10f6d52f683/68747470733a2f2f7472617669732d63692e6f72672f656c79746879722f70726f6f70682d66697874757265732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/elythyr/prooph-fixtures)[![Coverage Status](https://camo.githubusercontent.com/fcb375d23b391ab85eed72eb14d519dad3f5015bfc1f4054bd7b62f958a88b97/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f656c79746879722f70726f6f70682d66697874757265732f6d61737465722e737667)](https://coveralls.io/github/elythyr/prooph-fixtures?branch=master)

During my experiments with ES I find myself in a situation where Doctrine data fixtures missed me.

Thats why I decided to try to reproduce something similar for Prooph.

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

[](#installation)

Oh, sweet Composer!

```
composer require --dev elythyr/prooph-fixtures
```

### Versions management

[](#versions-management)

Since its a practice project, I don't really care about BC breaks. I will only try to not break minor versions, meaning that:

- Updating from `1.0.0` to `1.0.9` should not break anything
- Updating from `1.0.0` to `1.1.0` might break a lot of stuff

Configuration
-------------

[](#configuration)

There is no configuration per se. All the configuration should already be done, see [Prooph EventStore](https://github.com/prooph/event-store)for more information.

Usage
-----

[](#usage)

An example of how to configure the pieces together:

```
// /test.php

// Configure your system:
// Replace it by your own container or create everything manually :'(
$container = new class() implements ContainerInterface {
    public function has($id) { return false; }
    public function get($id) { return null; }
};

// Retrieve your event store
$eventStore = $container->get('event_store');

// Create a provider for your fixtures
$fixturesProvider = new InMemoryFixturesProvider([
    $youContainer->get('a_fixture'),
    $youContainer->get('another_fixture'),
    // ...
]);

// Retrieve the cleaning projection strategy
// No implementations are provided since it depends on your EventStore implementation
$cleaningProjectionStrategy = $container->get('cleaning_projection_strategy');

// Retrieve the names of all your projections
$projectionsNames = $container->get('projections_names');

// Create the cleaner you want to use, here we will clean both event streams and projections
$cleaner = new ChainCleaner([
    new EventStreamsCleaner($eventStore),
    new ProjectionsCleaner(
        $cleaningProjectionStrategy,
        $projectionsNames
    ),
]);

// Create the fixtures manager, just a front to regroup everything in one place
$fixturesManager = new FixturesManager($fixturesProvider, $cleaner);

// Lets do some cleaning !
$fixturesManager->cleanUp();

// Loading is so easy, you can do it yourself :)
// Under the hood the manager do all the heavy lifting by ordering the fixtures
foreach ($fixturesManager->getFixtures() as $fixture) {
    $fixture->load();
}
```

Todo
----

[](#todo)

- Adds CI with Travis
- Adds tests coverage
- Make a first release
- Publish to packagist
- (When needed) Adds the possibility to not clean the DB
- (When needed) Adds the possibility to filter the fixtures to load

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~36 days

Total

2

Last Release

2655d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef5f1b88540b82e331f14d258ffb106e0bcfbd6154a2363c6dfd4ea3d0328813?d=identicon)[elythyr](/maintainers/elythyr)

---

Top Contributors

[![camilledejoye](https://avatars.githubusercontent.com/u/11501572?v=4)](https://github.com/camilledejoye "camilledejoye (2 commits)")

---

Tags

data-fixturesevent-sourcefixturesprooph

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elythyr-prooph-fixtures/health.svg)

```
[![Health](https://phpackages.com/badges/elythyr-prooph-fixtures/health.svg)](https://phpackages.com/packages/elythyr-prooph-fixtures)
```

###  Alternatives

[illuminate/contracts

The Illuminate Contracts package.

704122.9M10.1k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31278.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/object-mapper

Provides a way to map an object to another object

34885.7k18](/packages/symfony-object-mapper)

PHPackages © 2026

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