Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camilledejoye/prooph-fixtures-bundle
Clean your DB and reload your events !
https://github.com/camilledejoye/prooph-fixtures-bundle
data-fixtures event-source fixtures prooph prooph-fixtures symfony-bundle
Last synced: 20 days ago
JSON representation
Clean your DB and reload your events !
- Host: GitHub
- URL: https://github.com/camilledejoye/prooph-fixtures-bundle
- Owner: camilledejoye
- License: mit
- Created: 2018-12-27T00:04:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-03T18:48:52.000Z (almost 6 years ago)
- Last Synced: 2024-10-08T19:04:04.352Z (about 1 month ago)
- Topics: data-fixtures, event-source, fixtures, prooph, prooph-fixtures, symfony-bundle
- Language: PHP
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prooph Fixtures Bundle
[![Build Status](https://travis-ci.org/elythyr/prooph-fixtures-bundle.svg?branch=master)](https://travis-ci.org/elythyr/prooph-fixtures-bundle)
[![Coverage Status](https://img.shields.io/coveralls/github/elythyr/prooph-fixtures-bundle/master.svg)](https://coveralls.io/github/elythyr/prooph-fixtures-bundle?branch=master)Symfony's Bundle for [Prooph Fixtures](https://github.com/elythyr/prooph-fixtures).
Provides an easy integration of the library inside symfony by auto configuring the fixtures
and providing a console command to load all your fixtures.## Installation
```shell
composer require --dev elythyr/prooph-fixtures-bundle
```#### 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
#### Projection cleaning strategy
By default the PdoCleaningProjectionStrategy will be used.
If you don't use [prooph/pdo-event-store](https://github.com/prooph/pdo-event-store), then you will
have to provide your own cleaning strategy and defined it as an alias to
`prooph_fixtures.cleaning_projection_strategy`:```yaml
services:
prooph_fixtures.cleaning_projection_strategy:
alias: App\Infrastructure\Cleaner\CustomProjectionCleaningStrategy
```#### Fixtures
There is nothing to configure!
Just make sure that your fixtures are defined as services and implements
`Prooph\Fixtures\Fixture\Fixture` so they will be autoconfigured by the Bundle.If you do not use autoconfiguration, then you must add the tag to all of your fixtures:
```yaml
# config/services.yaml
services:
# On a per class basis
App\DataFixtures\MyAllNewFixtures:
tags: ['prooph_fixtures.fixtures']# For an entire directory
App\DataFixtures\:
resource: '../src/DataFixtures'
tags: ['prooph_fixtures.fixtures']
```## Usage
Simply go to your terminal and type:
```shell
php bin/console event-store:fixtures:load
```## Todo
- [x] Adds CI with Travis
- [x] Adds tests coverage
- [x] Make a first release
- [x] Publish to packagist
- [ ] \(Wondering) Adds events before/after: cleaning, loading all fixtures, loagin each fixture