You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Théo FIDRY 0643d10a8b Update documentation (#273) 5 years ago
bin Add test for the command (#262) 5 years ago
doc Update documentation (#273) 5 years ago
fixtures Harden tests for command (#269) 5 years ago
resources/config Add test for the command (#262) 5 years ago
src Add test for the command (#262) 5 years ago
tests Harden tests for command (#269) 5 years ago
.editorconfig Travis improvements 6 years ago
.gitignore Merge 1.x to master (#270) 5 years ago
.php_cs Use package autoload 6 years ago
.scrutinizer.yml Enhance Travis (#226) 6 years ago
.styleci.yml Add test for the command (#262) 5 years ago
.travis.yml Harden tests for command (#269) 5 years ago Update 6 years ago
LICENSE Move doc to the root (#246) 5 years ago Update documentation (#273) 5 years ago Update documentation (#273) 5 years ago
composer.json Harden tests for command (#269) 5 years ago
phpunit.xml.dist Harden tests for command (#269) 5 years ago


A Symfony bundle to manage fixtures with nelmio/alice and fzaninotto/Faker.

The database support is done in FidryAliceDataFixtures. Check this project to know which database/ORM is supported.

Warning: this doc is behind updated for HautelookAliceBundle 2.0. If you want to check the documentation for 1.x, head this way.

Package version Build Status SensioLabsInsight Dependency Status Scrutinizer Code Quality Code Coverage



  1. Install
  2. Basic usage
  3. Advanced usage
    1. Enabling databases
    2. Environment specific fixtures
    3. Fixtures parameters
      1. Alice parameters
      2. Application parameters
  4. Custom Faker Providers
  5. Custom Alice Processors
  6. Resources

Other references:


Example of installation:

composer require --dev hautelook/alice-bundle \
doctrine/data-fixtures \
theofidry/alice-persistence \
doctrine/orm-bundle \
doctrine/orm \

Explanation: HautelookAliceBundle uses FidryAliceDataFixtures for the persistence layer. As FidryAliceDataFixtures is compatible with different databases/ORM, one cannot be installed by default. In the example above, we are using Doctrine ORM which requires doctrine/orm doctrine/orm-bundle doctrine/data-fixtures.

Then, enable the bundle by updating your app/AppKernel.php file to enable the bundle:

// app/AppKernel.php

public function registerBundles()
    $bundles = [
        new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
        // ...
        new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
    if (in_array($this->getEnvironment(), ['dev', 'test'])) {
        $bundles[] = new Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle;
        $bundles[] = new Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle();
        $bundles[] = new Hautelook\AliceBundle\HautelookAliceBundle();

    return $bundles;

Configure the bundle to your needs (example with default values):

# app/config/config_dev.yml

    fixtures_path: 'Resources/fixtures/orm' # Path to which to look for fixtures relative to the bundle path.

Basic usage

Assuming you are using Doctrine, make sure you have the doctrine/doctrine-bundle and doctrine/data-fixtures packages installed.

Then create a fixture file in app/Resources/fixtures/orm:

# app/Resources/fixtures/orm/dummy.yml

        name: <name()>
        related_dummy: '@related_dummy*'
# app/Resources/fixtures/orm/related_dummy.yml

        name: <name()>

Then simply load your fixtures with the doctrine command php app/console fixtures:load.

If you want to load the fixtures of a bundle only, do php app/console fixtures:load -b MyFirstBundle -b MySecondBundle.

See more.
Next chapter: Advanced usage



This bundle was originaly developped by Baldur RENSCH and HauteLook. It is now maintained by Théo FIDRY.

Other contributors.