PHPackages                             robmasters/filler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. robmasters/filler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

robmasters/filler
=================

Easy to use PHP Fixtures library

09PHP

Since Sep 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/RobMasters/Filler)[ Packagist](https://packagist.org/packages/robmasters/filler)[ RSS](/packages/robmasters-filler/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Filler
======

[](#filler)

[![Build Status](https://camo.githubusercontent.com/df6f2b0e5fffcd106f9b69977d19a8262914fcc011c833cac42f26f1aaf69e5e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f526f624d6173746572732f46696c6c65722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/RobMasters/Filler)

Filler is designed to be a fixtures library that makes life as simple as possible for developers. Unlike other popular fixture libraries, Filler doesn't make you responsible for specifying the order that fixtures need to load in order for dependencies to be available - you simply declare what dependencies you need where you need them.

Filler can be used with any persistance layer, such as Propel1, Propel2, Doctrine2, or even your own home-grown persistance layer. The only assumption that is made is that your model classes have setter methods (e.g. setName, setEmail) to load data. At present only Propel1 is supported out-of-the-box, but it is straight-forward to provide your own `Persistor` object to tell Filler how to persist your models.

Installation
------------

[](#installation)

The easiest way to install Filler is by using [Composer](http://getcomposer.org):

```
$> curl -s https://getcomposer.org/installer | php
$> php composer.phar require robmasters/filler='dev-master'
```

### Configuring

[](#configuring)

Add a `filler.yml` file to the root of your project, or alternatively into a `config` directory:

```
filler:
    fixtures_path: fixtures
    connection:    propel                       # Value can be any of the top-level keys below

propel:
    config_file: build/conf/filler-conf.php     # Path to your Propel config file
    class_path:  build/classes                  # Path to your Propel classes directory

# TODO: add more connection types. Only Propel1 is supported for now

```

Defining Fixtures
-----------------

[](#defining-fixtures)

Add one or more fixture classes to your configured fixtures path. It is entirely up to you whether you prefer to use a new class for each database table or subject area. The only requirement is that all fixture classes must implement the `Filler\Fixture` interface.

For example, here are two fixture files that provide some data for a simple movie rental service:

**fixtures/UserFixtures.php**

```
