Download the PHP package theofidry/alice-fixtures-extension without Composer
On this page you can find all versions of the php package theofidry/alice-fixtures-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package alice-fixtures-extension
AliceBundleExtension
A Behat extension to load HautelookAliceBundle fixtures.
Installation
You can use Composer to install the bundle to your project:
Then, in your behat config file behat.yml
, register the extension and declare the context:
You have three contexts available:
Fidry\AliceBundleExtension\Context\Doctrine\AliceODMContext
Fidry\AliceBundleExtension\Context\Doctrine\AliceORMContext
Fidry\AliceBundleExtension\Context\Doctrine\AlicePHPCRContext
With the default fixtures basePath respectively at:
%paths.base%/tests/Features/fixtures/ODM
%paths.base%/tests/Features/fixtures/ORM
%paths.base%/tests/Features/fixtures/PHPCR
Basic usage
Assuming you have the same configuration as the Installation section, you can create the following fixture file:
Then simply load your fixtures with the following step:
Loading fixture parameters
Fixture parameters can be loaded in the same way as loading fixtures. Any available step which loads fixtures, can also load parameters. You have to load your parameters before the dependend fixtures:
Steps
For each context, you have the following steps available:
Loading fixture files can be done as follows:
Type of path | Fixtures file path | Computed fixtures file path |
---|---|---|
Relative path | `"dummy.yml"` | `contextBasePath/dummy.yml`, ex: `%paths.base%/tests/Features/fixtures/ORM/dummy.yml` |
@Bundle path | `"@AppBundle/DataFixtures/ORM/dummy.yml"` | `src/AppBundle/DataFixtures/ORM/dummy.yml` (example) |
Absolute path | `/dummy.yml` | unchanged |
Absolute directory path | `/tests/Features/fixtures/ORM/` | `/tests/Features/fixtures/ORM/*` |
@Bundle | `@AppBundle` | `src/AppBundle/DataFixtures/ORM/*` |
Paths can also be directories.
Credits
This library is developed by Théo FIDRY.
License
All versions of alice-fixtures-extension with dependencies
behat/behat Version ~3.0
behat/symfony2-extension Version ^2.0
hautelook/alice-bundle Version ~1.0