PHPackages                             saeven/zf3-circlical-behat-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. saeven/zf3-circlical-behat-fixtures

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

saeven/zf3-circlical-behat-fixtures
===================================

Doctrine &amp; Nelmio/Alice fixtures for Zend Framework 3 and Behat

0.9.1(5y ago)09.7k—3.3%MPL-2.0PHPPHP ^7.4.0

Since Mar 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Saeven/circlical-behat-fixtures)[ Packagist](https://packagist.org/packages/saeven/zf3-circlical-behat-fixtures)[ Docs](https://github.com/Saeven/zf3-circlical-behat-fixtures)[ RSS](/packages/saeven-zf3-circlical-behat-fixtures/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (17)Versions (3)Used By (0)

Simpler Behat Fixtures for Doctrine &amp; Laminas
=================================================

[](#simpler-behat-fixtures-for-doctrine--laminas)

Trigger fixture loading from within Behat tests, like so:

```
Feature: I can define fixtures from within my tests
  In order to keep my test database clean
  As a developer writing behat tests
  I want to load fixtures directly from within my test context

  Scenario: Test loading a new fixture
    Given fixture "Application/user" is loaded
    And fixture "Application/user" is loaded
    And fixtures "Application/user, Billing/invoices" are loaded

```

> This package adds a behavior to alice, by way of automatically falling back onto reflection when a setter for a fixture-defined value is not available, and that value is nontrivial.

Highlights:

- fixtures provided by the excellent [nelmio/alice](https://github.com/nelmio/alice)
- comes with a ready-to-go context you can plug into Behat
- define what fixtures are required right at the Scenario level
- adds a convenient CLI command as well

> Inspired by [dkorsak/doctrine-data-fixture-module](https://github.com/dkorsak/doctrine-data-fixture-module) -- thanks!

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

[](#installation)

- Composer install, then add `CirclicalBehatFixtures` to your application.config.php

Wiring it into Behat
--------------------

[](#wiring-it-into-behat)

- Edit your behat.yml, to add the `CirclicalBehatFixtures\Behat\DatabaseContext` context

e.g.

```
# behat.yml
default:
  autoload: [ '%paths.base%/../contexts' ]
  suites:
    core_features:
      paths: [ '%paths.base%/../features' ]
      contexts:
        - FeatureContext
        - CirclicalBehatFixtures\Behat\DatabaseContext

```

### Or, if you need to override the location of the Doctrine bin (where the symlink points to)

[](#or-if-you-need-to-override-the-location-of-the-doctrine-bin-where-the-symlink-points-to)

```
# behat.yml
default:
  autoload: [ '%paths.base%/../contexts' ]
  suites:
    core_features:
      paths: [ '%paths.base%/../features' ]
      contexts:
        - FeatureContext
        - CirclicalBehatFixtures\Behat\DatabaseContext:
          - vendor/doctrine/doctrine-module/bin/doctrine-module

```

Author a Fixture
----------------

[](#author-a-fixture)

The syntax for fixture identification is very simple, MODULE/fixturename. Examples:

- Application/user
- Application/roles
- Member/purchases

In your individual ZF modules, you will save your [nelmio/alice](https://github.com/nelmio/alice) fixtures as `module/MODULE/user.yml`. Examples based on fixture IDs above:

- module/Application/fixtures/user.yml
- module/Application/fixtures/roles.yml
- module/Member/fixtures/purchases.yml

Author a Scenario
-----------------

[](#author-a-scenario)

Do this the way you usually would. The context provided by this module gives you a new action:

`Given Fixture "FIXTUREID" is loaded`

e.g.

`Given Fixture "Application/user" is loaded`

You can stack these as you need. The first one in a feature will auto-purge, the subsequent ones will append.

Container Support
-----------------

[](#container-support)

If you need to import the fixture in a Docker command for example, perhaps as a part of a CI/CD chain, you'll need to change where the fixture gets loaded. In short, instead of this command:

```
vendor/bin/doctrine-module orm:fixtures:load --fixtures=Application/orders

```

You might need to run something like this command:

```
/usr/local/bin/docker container exec -w /code -i $(docker-compose ps -q php) php vendor/bin/doctrine-module orm:fixtures:load --fixtures=Application/orders

```

You can achieve this by outputting a prefix into a file with name `circlical-fixtures-cmd-prefix`, e.g. in your CI/CD scripts:

```
echo "/usr/local/bin/docker container exec -w /code -i $(docker-compose ps -q php) " > ./circlical-fixtures-cmd-prefix

```

It becomes your responsibility to create (at startup) and delete (at tear-down) this file in your CI chain configuration.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~338 days

Total

2

Last Release

1975d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/887224?v=4)[Alexandre Lemaire](/maintainers/Saeven)[@Saeven](https://github.com/Saeven)

---

Top Contributors

[![Saeven](https://avatars.githubusercontent.com/u/887224?v=4)](https://github.com/Saeven "Saeven (12 commits)")

---

Tags

fixturesdoctrineBehataliceZend Frameworkzf3nelmio

### Embed Badge

![Health badge](/badges/saeven-zf3-circlical-behat-fixtures/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[sulu/sulu

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

1.3k1.4M204](/packages/sulu-sulu)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[concrete5/core

Concrete core subtree split

20166.1k52](/packages/concrete5-core)[api-platform/doctrine-common

Common files used by api-platform/doctrine-orm and api-platform/doctrine-odm

274.4M48](/packages/api-platform-doctrine-common)

PHPackages © 2026

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