You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, install [Foundry](https://github.com/zenstruck/foundry) and [Doctrine/DoctrineFixturesBundle](https://github.com/doctrine/DoctrineFixturesBundle):
24
24
25
25
```console
26
26
docker compose exec php \
27
-
composer require --dev alice
27
+
composer require --dev foundry orm-fixtures
28
28
```
29
29
30
-
Thanks to Symfony Flex, Alice (and [AliceBundle](https://github.com/theofidry/AliceBundle)) are ready to use!
31
-
Place your data fixtures files in a directory named `fixtures/`.
30
+
Thanks to Symfony Flex, [DoctrineFixturesBundle](https://github.com/doctrine/DoctrineFixturesBundle) and [Foundry](https://github.com/zenstruck/foundry) are ready to use!
32
31
33
-
Then, create some fixtures for [the bookstore API you created in the tutorial](index.md):
32
+
Then, create some factories for [the bookstore API you created in the tutorial](index.md):
public function load(ObjectManager $manager): void
134
+
{
135
+
DefaultBooksStory::load();
136
+
DefaultReviewsStory::load();
137
+
}
138
+
}
55
139
```
56
140
57
141
You can now load your fixtures in the database with the following command:
58
142
59
143
```console
60
144
docker compose exec php \
61
-
bin/console hautelook:fixtures:load
145
+
bin/console doctrine:fixtures:load
62
146
```
63
147
64
-
To learn more about fixtures, take a look at the documentation of [Alice](https://github.com/nelmio/alice)
65
-
and [AliceBundle](https://github.com/theofidry/AliceBundle).
66
-
The list of available generators as well as a cookbook explaining how to create custom generators can be found in the documentation of [Faker](https://github.com/fakerphp/faker), the library used by Alice under the hood.
148
+
To learn more about fixtures, take a look at the documentation of [Foundry](https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html).
149
+
The list of available generators as well as a cookbook explaining how to create custom generators can be found in the documentation of [Faker](https://github.com/fakerphp/faker), the library used by Foundry under the hood.
67
150
68
151
## Writing Functional Tests
69
152
@@ -260,7 +343,6 @@ The API Platform Demo [contains a CD worklow](https://github.com/api-platform/de
260
343
261
344
You may also be interested in these alternative testing tools (not included in the API Platform distribution):
262
345
263
-
*[Foundry](https://github.com/zenstruck/foundry), a modern fixtures library that will replace Alice as the recommended fixtures library soon;
264
346
*[Hoppscotch](https://docs.hoppscotch.io/features/tests), create functional test for your API
265
347
Platform project using a nice UI, benefit from its Swagger integration and run tests in the CI using [the command-line tool](https://docs.hoppscotch.io/cli);
0 commit comments