|
1 | | -# DoctrineDataFixturesExtension |
| 1 | +Doctrine Fixtures Extension for Behat |
| 2 | +===================================== |
2 | 3 |
|
3 | | -Increase feature test isolation by reloading ORM data fixtures between features. |
| 4 | +The extension increases feature test isolation by reloading ORM data fixtures between scenarios and features. |
4 | 5 |
|
5 | | -## Documentation |
| 6 | +# Installation |
6 | 7 |
|
7 | | -[Official documentation](http://extensions.behat.org/doctrine-data-fixtures/index.html) |
| 8 | +This extension requires: |
8 | 9 |
|
9 | | -## Source |
| 10 | +* Behat 3.0+ |
| 11 | +* Mink 1.4+ |
| 12 | +* Doctrine ORM 2.x |
| 13 | +* [Symfony2Extension](http://extensions.behat.org/symfony2/) |
10 | 14 |
|
11 | | -[Github](https://github.com/vipsoft/DoctrineDataFixturesExtension) |
| 15 | +## Through Composer |
12 | 16 |
|
13 | | -## Copyright |
| 17 | +```sh |
| 18 | +composer require "behat-extension/doctrine-data-fixtures-extension" |
| 19 | +``` |
14 | 20 |
|
15 | | -Copyright (c) 2012 Anthon Pang. See LICENSE for details. |
| 21 | +#Configuration |
16 | 22 |
|
17 | | -## Credits |
| 23 | +Activate extension in your **behat.yml** and define any fixtures to be loaded: |
18 | 24 |
|
19 | | -* Anthon Pang [robocoder](http://github.com/robocoder) |
20 | | -* Konstantin Kudryashov [everzet](http://github.com/everzet) - init.php and build.php |
21 | | -* [Others](https://github.com/vipsoft/DoctrineDataFixturesExtension/graphs/contributors) |
| 25 | +```yaml |
| 26 | +# behat.yml |
| 27 | +default: |
| 28 | + # ... |
| 29 | + extensions: |
| 30 | + BehatExtension\DoctrineDataFixturesExtension\Extension: |
| 31 | + lifetime: feature |
| 32 | + autoload: true |
| 33 | + directories: ~ |
| 34 | + fixtures: ~ |
| 35 | +``` |
| 36 | +
|
| 37 | +When **lifetime** is set to "feature" (or unspecified), data fixtures are reloaded between feature files. Alternately, |
| 38 | +when **lifetime** is set to "scenario", data fixtures are reloaded between scenarios (i.e., increased |
| 39 | +test isolation at the expense of increased run time). |
| 40 | +
|
| 41 | +When **autoload** is true, the DoctrineDataFixtures extension will load the data fixtures for all |
| 42 | +registered bundles (similar to `app/console doctrine:fixtures:load`). |
| 43 | + |
| 44 | +When **fixtures** is set and **autoload** is false, the DoctrineDataFixtures |
| 45 | +extension will load the specified fixture classes. |
| 46 | + |
| 47 | +When **directories** is set and **autoload** is false, the DoctrineDataFixtures |
| 48 | +extension will load the data fixtures globed from the respective directories. |
| 49 | + |
| 50 | +```yaml |
| 51 | +# behat.yml |
| 52 | +default: |
| 53 | + # ... |
| 54 | + extensions: |
| 55 | + BehatExtension\DoctrineDataFixturesExtension\Extension: |
| 56 | + lifetime: feature |
| 57 | + autoload: true |
| 58 | + directories: |
| 59 | + - /project/src/AcmeAnalytics/Tests/DataFixtures/ORM |
| 60 | + fixtures: |
| 61 | + - Acme\StoreBundle\DataFixture\ORM\Categories |
| 62 | + - Acme\StoreBundle\DataFixture\ORM\Apps |
| 63 | + - Acme\VendorBundle\DataFixture\ORM\Vendors |
| 64 | +``` |
| 65 | + |
| 66 | +# Limitations |
| 67 | + |
| 68 | +When using the SqlLiteDriver, the .db file is cached to speed up reloading. 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. |
| 69 | + |
| 70 | +# Source |
| 71 | + |
| 72 | +`Github <https://github.com/vipsoft/DoctrineDataFixturesExtension>`_ |
| 73 | + |
| 74 | +Forked from `Github <https://github.com/BehatExtension/DoctrineDataFixturesExtension>`_ |
| 75 | + |
| 76 | +# Copyright |
| 77 | + |
| 78 | +* Copyright (c) 2012 Anthon Pang. |
| 79 | +* Copyright (c) 2016 Florent Morselli. |
| 80 | + |
| 81 | +See [LICENSE](LICENSE) for details. |
| 82 | + |
| 83 | +# Contributors |
| 84 | + |
| 85 | +* Anthon Pang `(robocoder) <http://github.com/robocoder>`_ |
| 86 | +* `Others <https://github.com/BehatExtension/DoctrineDataFixturesExtension/graphs/contributors>`_ |
0 commit comments