Skip to content

Commit 836df3d

Browse files
committed
feat: update read me
1 parent 7c07ec6 commit 836df3d

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff 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
=============
3737
Example you have http client in `config/services.yaml`
3838
```yaml
@@ -46,10 +46,6 @@ Example you have http client in `config/services.yaml`
4646
Now you need mock this client in `config/services_test.yaml`
4747

4848
```yaml
49-
BehatHttpMockContext\Collection\ExtendedMockHttpClientCollection:
50-
arguments:
51-
- !tagged_iterator mock.http_client
52-
5349
oauth_http_client:
5450
class: ExtendedMockHttpClient\ExtendedMockHttpClient
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\Collection\ExtendedMockHttpClientCollection:
60+
arguments:
61+
- !tagged_iterator mock.http_client
62+
...
63+
```
64+
6165
Step 4: Configure Behat
6266
=============
6367
Go 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

0 commit comments

Comments
 (0)