File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ In the `config/services_test.yaml` file of your project:
3232 - !tagged_iterator mock.http_client
3333` ` `
3434
35- Step 2: Mock http
35+ Step 2: Mock http client
3636=============
3737Example you have http client in ` config/services.yaml`
3838` ` ` yaml
@@ -46,10 +46,6 @@ Example you have http client in `config/services.yaml`
4646Now you need mock this client in `config/services_test.yaml`
4747
4848` ` ` yaml
49- BehatHttpMockContext\C ollection\E xtendedMockHttpClientCollection:
50- arguments:
51- - !tagged_iterator mock.http_client
52-
5349 oauth_http_client:
5450 class: ExtendedMockHttpClient\E xtendedMockHttpClient
5551 arguments:
@@ -58,6 +54,14 @@ Now you need mock this client in `config/services_test.yaml`
5854...
5955` ` `
6056
57+ Now we ready add build mock collection
58+ ` ` ` yaml
59+ BehatHttpMockContext\C ollection\E xtendedMockHttpClientCollection:
60+ arguments:
61+ - !tagged_iterator mock.http_client
62+ ...
63+ ` ` `
64+
6165Step 4 : Configure Behat
6266=============
6367Go to `behat.yml`
@@ -69,6 +73,20 @@ Go to `behat.yml`
6973...
7074` ` `
7175
76+ Step 4 : How to use:
77+ =============
78+ ```
79+ Given I mock "oauth_http_client" HTTP client next response status code should be 200 with body:
80+ """
81+ {
82+ "success": true,
83+ "response": {
84+ "user_id": 234
85+ }
86+ }
87+ """
88+ ```
89+
7290[main Build Status]: https://github.com/macpaw/BehatHttpMockContext/actions?query=workflow%3ACI+branch%3Amain
7391[main Build Status Image]: https://github.com/macpaw/BehatHttpMockContext/workflows/CI/badge.svg?branch=main
7492[develop Build Status]: https://github.com/macpaw/BehatHttpMockContext/actions?query=workflow%3ACI+branch%3Adevelop
You can’t perform that action at this time.
0 commit comments