oligus / doctrine-fixtures
Doctrine fixtures
0.1.6
2026-06-07 20:00 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
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^6.0 || ^7.0
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'"