PHPackages                             macpaw/behat-doctrine-fixtures - 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. macpaw/behat-doctrine-fixtures

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

macpaw/behat-doctrine-fixtures
==============================

Bundle for creating Doctrine fixtures

v3.0(1y ago)7243.6k↓40%2[1 issues](https://github.com/MacPaw/behat-doctrine-fixtures/issues)[2 PRs](https://github.com/MacPaw/behat-doctrine-fixtures/pulls)MITPHPPHP ^7.4 || ^8.0

Since Jan 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/MacPaw/behat-doctrine-fixtures)[ Packagist](https://packagist.org/packages/macpaw/behat-doctrine-fixtures)[ RSS](/packages/macpaw-behat-doctrine-fixtures/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (7)Dependencies (16)Versions (11)Used By (0)

Behat Doctrine Fixtures
=======================

[](#behat-doctrine-fixtures)

VersionBuild StatusCode Coverage`master`[![CI](https://github.com/macpaw/behat-doctrine-fixtures/workflows/CI/badge.svg?branch=master)](https://github.com/macpaw/behat-doctrine-fixtures/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/068327d5edc7435a6cc1319322555d5dcaeeb386bdd1505b5111007be361b87c/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d61637061772f62656861742d646f637472696e652d66697874757265732f6d61737465723f6c6f676f3d636f6465636f76)](https://codecov.io/gh/macpaw/behat-doctrine-fixtures/branch/master)`develop`[![CI](https://github.com/macpaw/behat-doctrine-fixtures/workflows/CI/badge.svg?branch=develop)](https://github.com/macpaw/behat-doctrine-fixtures/actions?query=workflow%3ACI+branch%3Adevelop)[![Coverage Status](https://camo.githubusercontent.com/e87414bedbc636845cdd5ae880945c2856182b0d4f7b4bd80133bf4491887570/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d61637061772f62656861742d646f637472696e652d66697874757265732f646576656c6f703f6c6f676f3d636f6465636f76)](https://codecov.io/gh/macpaw/behat-doctrine-fixtures/branch/develop)Installation
------------

[](#installation)

To install the Behat Doctrine Fixtures and integrate it with your Behat setup, follow the instructions provided in the [Installation Guide](docs/install.md).

Database Support
----------------

[](#database-support)

This library allows you to easily work with fixtures for testing in Behat using Doctrine. It supports two types of databases:

- [How to configure SQLite](docs/configure_sqlite.md) – a lightweight and fast database for testing.
- [How to configure PostgreSQL](docs/configure_postgre.md) – a powerful and popular relational database for production-like environments.
- [How multiple databases](docs/configure_multiple_databases.md) - To configure multiple databases, define separate connection settings for each database in your Doctrine configuration and reference them appropriately in your application.

How Usage in Behat
------------------

[](#how-usage-in-behat)

These methods can be used in Behat scenarios to load fixtures into the database, preparing test data for scenarios. For more detailed information on each method, refer to the links above.

### Methods

[](#methods)

#### [beforeScenario](docs/DatabaseContext/beforeScenario.md)

[](#beforescenario)

The `beforeScenario` method loads fixtures for all configured database connections before each Behat scenario. This ensures that the database is in a clean state before testing.

#### [loadFixturesForDefaultConnection](docs/DatabaseContext/loadFixturesForDefaultConnection.md)

[](#loadfixturesfordefaultconnection)

The `loadFixturesForDefaultConnection` method loads fixtures into the default database connection. It accepts a comma-separated list of fixture names and loads them into the default connection.

#### [loadFixturesForGivenConnection](docs/DatabaseContext/loadFixturesForGivenConnection.md)

[](#loadfixturesforgivenconnection)

The `loadFixturesForGivenConnection` method loads fixtures into a specified database connection. This method allows flexibility by letting you choose which database connection the fixtures should be loaded into, which is useful in multi-database environments.

Migrate from 1.x to 2.0
-----------------------

[](#migrate-from-1x-to-20)

[To migrate from 1.x to 2.0, follow our guide.](https://github.com/MacPaw/behat-doctrine-fixtures/blob/master/UPGRADE-2.0.md)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~124 days

Total

8

Last Release

714d ago

Major Versions

v1.0.1 → v2.0.02022-05-17

v2.2.0 → v3.02024-06-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1935412?v=4)[MacPaw Inc.](/maintainers/macpaw)[@MacPaw](https://github.com/MacPaw)

![](https://www.gravatar.com/avatar/415a6c5f079859104abefc3592ee26337cfdb8466a98d1fadcd010072414523e?d=identicon)[Yozhef](/maintainers/Yozhef)

![](https://www.gravatar.com/avatar/d52c67d98f7c8c891f138e54370ee1d38b89d2be5e952eb4b586cdc69a6652eb?d=identicon)[igorgg](/maintainers/igorgg)

---

Top Contributors

[![IiiigorGG](https://avatars.githubusercontent.com/u/46721494?v=4)](https://github.com/IiiigorGG "IiiigorGG (51 commits)")[![Yozhef](https://avatars.githubusercontent.com/u/8971757?v=4)](https://github.com/Yozhef "Yozhef (45 commits)")[![serhiidonii](https://avatars.githubusercontent.com/u/158484424?v=4)](https://github.com/serhiidonii "serhiidonii (14 commits)")[![alekseytupichenkov](https://avatars.githubusercontent.com/u/8191991?v=4)](https://github.com/alekseytupichenkov "alekseytupichenkov (3 commits)")

---

Tags

backendbehatbehat-contextbehat-doctrine-contextdoctrine-fixturemacpawsymfonyFixtureBDDdoctrineContextBehatMacPaw

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/macpaw-behat-doctrine-fixtures/health.svg)

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

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[hautelook/alice-bundle

Symfony bundle to manage fixtures with Alice and Faker.

19519.4M34](/packages/hautelook-alice-bundle)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[macpaw/behat-messenger-context

Behat Context for testing Symfony Messenger component

16232.9k](/packages/macpaw-behat-messenger-context)

PHPackages © 2026

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