PHPackages                             lukeduda/doctrine-data-fixtures-extension - 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. [Database &amp; ORM](/categories/database)
4. /
5. lukeduda/doctrine-data-fixtures-extension

ActiveLibrary[Database &amp; ORM](/categories/database)

lukeduda/doctrine-data-fixtures-extension
=========================================

Doctrine data fixtures extension for Behat

v6.0.0(7y ago)037MITPHPPHP ^7.1

Since Aug 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lukeduda/DoctrineDataFixturesExtension)[ Packagist](https://packagist.org/packages/lukeduda/doctrine-data-fixtures-extension)[ Docs](http://github.com/BehatExtension/)[ RSS](/packages/lukeduda-doctrine-data-fixtures-extension/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (10)Versions (38)Used By (0)

Doctrine Fixtures Extension for Behat
=====================================

[](#doctrine-fixtures-extension-for-behat)

The extension increases feature test isolation by reloading ORM data fixtures between scenarios and features.

Installation
============

[](#installation)

```
composer require "behat-extension/doctrine-data-fixtures-extension"
```

Configuration
=============

[](#configuration)

Activate extension in your **behat.yml** and define any fixtures to be loaded:

```
# behat.yml
default:
  # ...
  extensions:
    BehatExtension\DoctrineDataFixturesExtension\Extension:
      lifetime:    'feature'
      directories: ~
      fixtures:    ~
```

When **lifetime** is set to "feature" (or unspecified), data fixtures are reloaded between feature files. Alternately, when **lifetime** is set to "scenario", data fixtures are reloaded between scenarios (i.e., increased test isolation at the expense of increased run time).

When **fixtures** is set, the extension will load the specified fixture classes. This must contain a list of fully qualified class names. Classes MUST not have any constructor arguments (or at least optional). If the interface `Symfony\Component\DependencyInjection\ContainerAwareInterface` is implemented, the container is set to the fixture loader.

When **directories** is set, the extension will load the data fixtures globed from the respective directories. Classes MUST not have any constructor arguments (or at least optional). If the interface `Symfony\Component\DependencyInjection\ContainerAwareInterface` is implemented, the container is set to the fixture loader.

This extension will also load every fixtures declared as services and tagged with `doctrine.fixture.orm`.

```
# behat.yml
default:
  # ...
  extensions:
    BehatExtension\DoctrineDataFixturesExtension\Extension:
      lifetime: 'feature'
      directories:
        - '/project/src/AcmeAnalytics/Tests/DataFixtures/ORM'
      fixtures:
        - 'Acme\StoreBundle\DataFixture\ORM\Categories'
        - 'Acme\StoreBundle\DataFixture\ORM\Apps'
        - 'Acme\VendorBundle\DataFixture\ORM\Vendors'
```

Backup System
=============

[](#backup-system)

To speed up the tests, a backup system is available. The whole database will be set in cache and reloaded when needed. You should periodically clear the cache as it does not detect changes to the data fixture contents because the hash is based on the collection of data fixture class names.

This feature is only available for SQLite, MySQL and PostgreSQL.

- For MySQL, `mysql` and `mysqldump` must be available.
- For PostgreSQL, `pg_restore` and `pg_dump` must be available.

It is enabled by default. To disable it, you just have to set `use_backup: false` in the extension configuration:

```
# behat.yml
default:
  # ...
  extensions:
    BehatExtension\DoctrineDataFixturesExtension\Extension:
      lifetime: 'feature'
      use_backup: false
```

Source
======

[](#source)

Github:

Forked from

Copyright
=========

[](#copyright)

- Copyright (c) 2012 Anthon Pang.
- Copyright (c) 2016-2018 Florent Morselli.

See [LICENSE](LICENSE) for details.

Contributors
============

[](#contributors)

- Anthon Pang ([robocoder](http://github.com/robocoder))
- Florent Morselli ([Spomky](http://github.com/Spomky))
- [Others contributors](https://github.com/BehatExtension/DoctrineDataFixturesExtension/graphs/contributors)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 80.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Recently: every ~57 days

Total

37

Last Release

2758d ago

Major Versions

0.10.3 → 2.5.02014-02-04

2.5.6 → 3.0.02015-10-06

3.0.0 → v4.0.02016-04-26

v4.0.x-dev → v5.0.02018-03-09

v5.0.x-dev → v6.0.02018-10-23

PHP version history (2 changes)v0.9PHP &gt;=5.3.6

v5.0.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/924b626901c7958ae082e1add32a70aefb1cd5b12beef18568e1e348ba94dbf3?d=identicon)[lukeduda](/maintainers/lukeduda)

---

Top Contributors

[![robocoder](https://avatars.githubusercontent.com/u/922051?v=4)](https://github.com/robocoder "robocoder (74 commits)")[![Spomky](https://avatars.githubusercontent.com/u/1091072?v=4)](https://github.com/Spomky "Spomky (4 commits)")[![coderbyheart](https://avatars.githubusercontent.com/u/188915?v=4)](https://github.com/coderbyheart "coderbyheart (2 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (2 commits)")[![unframework](https://avatars.githubusercontent.com/u/784414?v=4)](https://github.com/unframework "unframework (2 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (2 commits)")[![WillFink](https://avatars.githubusercontent.com/u/7439185?v=4)](https://github.com/WillFink "WillFink (1 commits)")[![boekkooi](https://avatars.githubusercontent.com/u/399895?v=4)](https://github.com/boekkooi "boekkooi (1 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (1 commits)")[![guilhermeblanco](https://avatars.githubusercontent.com/u/208883?v=4)](https://github.com/guilhermeblanco "guilhermeblanco (1 commits)")[![ruudk](https://avatars.githubusercontent.com/u/104180?v=4)](https://github.com/ruudk "ruudk (1 commits)")[![adrienbrault](https://avatars.githubusercontent.com/u/611271?v=4)](https://github.com/adrienbrault "adrienbrault (1 commits)")

---

Tags

BDDdoctrineBehatData fixtures

### Embed Badge

![Health badge](/badges/lukeduda-doctrine-data-fixtures-extension/health.svg)

```
[![Health](https://phpackages.com/badges/lukeduda-doctrine-data-fixtures-extension/health.svg)](https://phpackages.com/packages/lukeduda-doctrine-data-fixtures-extension)
```

###  Alternatives

[behat-extension/doctrine-data-fixtures-extension

Doctrine data fixtures extension for Behat

20546.2k1](/packages/behat-extension-doctrine-data-fixtures-extension)[vipsoft/doctrine-data-fixtures-extension

Doctrine data fixtures extension for Behat

21294.8k14](/packages/vipsoft-doctrine-data-fixtures-extension)[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92212.7M64](/packages/knplabs-doctrine-behaviors)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
