oligus / doctrine-fixtures
Doctrine fixtures
0.2.1
2026-09-23 12:14 UTC
Requires
- php: >=8.1
- ext-dom: *
- ext-libxml: *
- ext-simplexml: *
- doctrine/dbal: ^3.0 || ^4.0
- doctrine/orm: ^2.6 || ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.0 || ^11.0 || ^12.0
- spatie/phpunit-snapshot-assertions: ^5.4
- squizlabs/php_codesniffer: ^3.4
- symfony/cache: ^6.0 || ^7.0
- symfony/var-dumper: ^6.0 || ^7.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-23 12:15:14 UTC
README
Simple fixture loader for Doctrine.
Load XML fixtures into database using entity manager.
Quick start
$ composer require oligus/doctrine-fixtures --dev
Load all fixtures in a directory
$fixture = new FixtureManager($em, new XmlLoader('path/to/fixtures')); $fixture->loadAll();
Load a single fixture file
$fixture = new FixtureManager($em, new XmlLoader()); $fixture->loadFile('path/to/fixtures/data_table.xml');
Availible Loaders
- Xml Loader
- Csv Loader
Fixtures
Creating XML fixture from mysql database
$ mysqldump -h localhost -u username --password=password --xml -t database data_table --where="id='1'"
Development
A PHP CLI container with Composer is provided, so tests and linting do not depend on the host's PHP version.
docker compose run --rm php composer install
docker compose run --rm php composer test
docker compose run --rm php composer lint
To get a shell inside the container (the repo is mounted at /app; exit to leave):
docker compose run --rm php bash
The default is PHP 8.4. Run against another version with PHP_VERSION, e.g. PHP_VERSION=8.1 docker compose run --rm php composer test. Each version gets its own vendor/ volume, separate from the host's.