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
Copy file name to clipboardExpand all lines: distribution/testing.md
+23-23Lines changed: 23 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@ Let's learn how to use them!
11
11
12
12
In this article you'll learn how to use:
13
13
14
-
*[PHPUnit](https://phpunit.de/index.html), a testing framework to cover your classes with unit tests and to write
15
-
API-oriented functional tests thanks to its API Platform and [Symfony](https://symfony.com/doc/current/testing.html) integrations.
16
-
*[Alice](https://github.com/nelmio/alice) and [its Symfony
17
-
integration](https://github.com/hautelook/AliceBundle#database-testing), an expressive fixtures generator to write data fixtures.
14
+
-[PHPUnit](https://phpunit.de/index.html), a testing framework to cover your classes with unit tests and to write
15
+
API-oriented functional tests thanks to its API Platform and [Symfony](https://symfony.com/doc/current/testing.html) integrations.
16
+
-[Alice](https://github.com/nelmio/alice) and [its Symfony
17
+
integration](https://github.com/hautelook/AliceBundle#database-testing), an expressive fixtures generator to write data fixtures.
18
18
19
19
Official [Symfony recipes](https://flex.symfony.com/) are provided for both tools.
20
20
@@ -37,23 +37,23 @@ Then, create some fixtures for [the bookstore API you created in the tutorial](i
37
37
```yaml
38
38
# api/fixtures/books.yaml
39
39
App\Entity\Book:
40
-
book_{1..100}:
41
-
isbn: <isbn13()>
42
-
title: <sentence(4)>
43
-
description: <text()>
44
-
author: <name()>
45
-
publicationDate: <dateTime()>
40
+
book_{1..100}:
41
+
isbn: <isbn13()>
42
+
title: <sentence(4)>
43
+
description: <text()>
44
+
author: <name()>
45
+
publicationDate: <dateTime()>
46
46
```
47
47
48
48
```yaml
49
49
# api/fixtures/reviews.yaml
50
50
App\Entity\Review:
51
-
review_{1..200}:
52
-
rating: <numberBetween(0, 5)>
53
-
body: <text()>
54
-
author: <name()>
55
-
publicationDate: <dateTime()>
56
-
book: '@book_*'
51
+
review_{1..200}:
52
+
rating: <numberBetween(0, 5)>
53
+
body: <text()>
54
+
author: <name()>
55
+
publicationDate: <dateTime()>
56
+
book: "@book_*"
57
57
```
58
58
59
59
You can now load your fixtures in the database with the following command:
@@ -65,7 +65,7 @@ docker-compose exec php \
65
65
66
66
To learn more about fixtures, take a look at the documentation of [Alice](https://github.com/nelmio/alice)
67
67
and [AliceBundle](https://github.com/hautelook/AliceBundle).
68
-
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/fzaninotto/Faker), the library used by Alice under the hood.
68
+
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.
69
69
70
70
## Writing Functional Tests
71
71
@@ -217,7 +217,7 @@ publicationDate: This value should not be null.',
0 commit comments