Download the PHP package saeven/zf3-circlical-behat-fixtures without Composer
On this page you can find all versions of the php package saeven/zf3-circlical-behat-fixtures. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saeven/zf3-circlical-behat-fixtures
More information about saeven/zf3-circlical-behat-fixtures
Files in saeven/zf3-circlical-behat-fixtures
Package zf3-circlical-behat-fixtures
Short Description Doctrine & Nelmio/Alice fixtures for Zend Framework 3 and Behat
License MPL-2.0
Homepage https://github.com/Saeven/zf3-circlical-behat-fixtures
Informations about the package zf3-circlical-behat-fixtures
Simpler Behat Fixtures for Doctrine & Laminas
Trigger fixture loading from within Behat tests, like so:
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
- 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 -- thanks!
Installation
- Composer install, then add
CirclicalBehatFixtures
to your application.config.php
Wiring it into Behat
- Edit your behat.yml, to add the
CirclicalBehatFixtures\Behat\DatabaseContext
context
e.g.
Or, if you need to override the location of the Doctrine bin (where the symlink points to)
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 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
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
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.
All versions of zf3-circlical-behat-fixtures with dependencies
zendframework/zend-servicemanager Version ^3.0
zendframework/zend-mvc Version ^3.0
zendframework/zend-loader Version 2.6.*
zendframework/zend-modulemanager Version 2.8.*
zendframework/zend-eventmanager Version 3.2.*
doctrine/common Version 2.11.0
doctrine/orm Version ^2.5||2.6.*
doctrine/persistence Version @stable
doctrine/doctrine-orm-module Version ^1.1||2.1.*
doctrine/doctrine-module Version ^1.2||2.1.*
doctrine/data-fixtures Version @stable
nelmio/alice Version @stable
behat/behat Version 3.*@stable
symfony/console Version *