elythyr / prooph-fixtures-bundle
Symfony bundle for elythyr/prooph-fixtures
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1.3
- elythyr/prooph-fixtures: ^1.1
- prooph/event-store-symfony-bundle: ^0.5.0
- symfony/console: ^3.4 || ^4.0
- symfony/dependency-injection: ^3.4 || ^4.0
- symfony/expression-language: ^3.4 || ^4.0
- symfony/http-kernel: ^3.4 || ^4.0
- symfony/lock: ^3.4 || ^4.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpunit/php-invoker: ^2.0
- phpunit/phpunit: ^7.5
- prooph/php-cs-fixer-config: ^0.3.0
- symfony/var-dumper: ^3.4 || ^4.0
This package is auto-updated.
Last update: 2025-03-01 00:45:16 UTC
README
Symfony's Bundle for 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
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
to1.0.9
should not break anything - Updating from
1.0.0
to1.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, then you will
have to provide your own cleaning strategy and defined it as an alias to
prooph_fixtures.cleaning_projection_strategy
:
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:
# 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:
php bin/console event-store:fixtures:load
Todo
- Adds CI with Travis
- Adds tests coverage
- Make a first release
- Publish to packagist
- (Wondering) Adds events before/after: cleaning, loading all fixtures, loagin each fixture