Skip to content

Commit d95d15b

Browse files
committed
docs: change fakerPHP repository link
1 parent 07077a8 commit d95d15b

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

distribution/testing.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Let's learn how to use them!
1111

1212
In this article you'll learn how to use:
1313

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.
1818

1919
Official [Symfony recipes](https://flex.symfony.com/) are provided for both tools.
2020

@@ -37,23 +37,23 @@ Then, create some fixtures for [the bookstore API you created in the tutorial](i
3737
```yaml
3838
# api/fixtures/books.yaml
3939
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()>
4646
```
4747
4848
```yaml
4949
# api/fixtures/reviews.yaml
5050
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_*"
5757
```
5858
5959
You can now load your fixtures in the database with the following command:
@@ -65,7 +65,7 @@ docker-compose exec php \
6565

6666
To learn more about fixtures, take a look at the documentation of [Alice](https://github.com/nelmio/alice)
6767
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.
6969

7070
## Writing Functional Tests
7171

@@ -217,7 +217,7 @@ publicationDate: This value should not be null.',
217217
'email' => '[email protected]',
218218
'password' => 'admin',
219219
]]);
220-
220+
221221
$this->assertResponseIsSuccessful();
222222
}
223223
}
@@ -249,23 +249,23 @@ To do so, learn how to write unit tests with [PHPUnit](https://phpunit.de/index.
249249

250250
You may also be interested in these alternative testing tools (not included in the API Platform distribution):
251251

252-
* [Behat](http://behat.org/en/latest/) and its [Behatch extension](https://github.com/Behatch/contexts), a
252+
- [Behat](http://behat.org/en/latest/) and its [Behatch extension](https://github.com/Behatch/contexts), a
253253
[behavior-driven development (BDD)](https://en.wikipedia.org/wiki/Behavior-driven_development) framework to write the API
254254
specification as user stories and in natural language then execute these scenarios against the application to validate
255255
its behavior;
256-
* [Blackfire Player](https://blackfire.io/player), a nice DSL to crawl HTTP services, assert responses, and extract data
256+
- [Blackfire Player](https://blackfire.io/player), a nice DSL to crawl HTTP services, assert responses, and extract data
257257
from HTML/XML/JSON responses ([see example in API Platform Demo](https://github.com/api-platform/demo/blob/master/test-api.bkf));
258-
* [Postman tests](https://www.getpostman.com/docs/writing_tests) (proprietary), create functional test for your API
258+
- [Postman tests](https://www.getpostman.com/docs/writing_tests) (proprietary), create functional test for your API
259259
Platform project using a nice UI, benefit from [the Swagger integration](https://www.getpostman.com/docs/importing_swagger)
260260
and run tests in the CI using [newman](https://github.com/postmanlabs/newman);
261-
* [PHP Matcher](https://github.com/coduo/php-matcher), the Swiss Army knife of JSON document testing.
261+
- [PHP Matcher](https://github.com/coduo/php-matcher), the Swiss Army knife of JSON document testing.
262262

263263
## Using the API Platform Distribution for End-to-end Testing
264264

265265
If you would like to verify that your stack (including services such as the DBMS, web server, [Varnish](https://varnish-cache.org/))
266266
works, you need [end-to-end (E2E) testing](https://wiki.c2.com/?EndToEndPrinciple).
267267

268-
It is also useful to do a [smoke test](https://en.wikipedia.org/wiki/Smoke_testing_(software)) to check that your application
268+
It is also useful to do a [smoke test](<https://en.wikipedia.org/wiki/Smoke_testing_(software)>) to check that your application
269269
is working; for example, that the application's entrypoint is accessible. This could be used as a quick test after each
270270
Docker build to ensure that the Docker images are not broken.
271271

0 commit comments

Comments
 (0)