Download the PHP package theiconic/fixtures without Composer
On this page you can find all versions of the php package theiconic/fixtures. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download theiconic/fixtures
More information about theiconic/fixtures
Files in theiconic/fixtures
Package fixtures
Short Description Load fixtures into database from different formats: Yaml, XML, etc.
License MIT
Informations about the package fixtures
THE ICONIC Database Fixtures
Description
Fixture manager that allows you to easily load your test data fixtures from different formats into your test database. With an extensible design, it currently support fixtures in the following formats:
- Yaml
- JSON
- MySQL XML Dump
And it currently supports the following databases:
- MySQL
- Redis
The fixture manager also allows you to replace placeholders in your fixtures programatically. See examples below.
Usage
Suppose that you have two fixtures for your country and employee tables called country.xml and employee.yml, respectively. You load them into a MySQL database with a few lines of code:
That's it!
Also, FixtureManager has a fluent interface, this means you can chain method calls like...
In the values for your fixtures files you can put placeholders instead of real values, this allows you to change the values dynamically, such as, place the current date.
To do this, when creating the Fixture Manager pass an array with the keys in the form "fx:placeholder:
And the employee.xml file would be (notice the value of "age" field):
You can pass any value you want, just calculate it before passing it to the create static method.
Installation
Use Composer to install this package.
Fixtures Files Examples
XML, use it when you are dealing with fixtures that have NULL values and dates.
As an example, you can generate MySQL XML dumps from the commmand line like so
Yaml, use it for simple data that does not has NULL values or dates.
JSON
Contributors
- Jorge A. Borges - Main Developer (http://jorgeborges.me)
- Aaron Weatherall - (http://www.aaronweatherall.com)
- Ollie Brennan - (http://www.epicarena.com)
License
THE ICONIC Database Fixtures is released under the MIT License.
All versions of fixtures with dependencies
symfony/yaml Version ~2.5 || ^3.0
symfony/finder Version ~2.5 || ^3.0
symfony/filesystem Version ~2.5 || ^3.0