Skip to content

Commit eb09c96

Browse files
committed
Add an example 'How to use it' in README file
1 parent 73e4cc4 commit eb09c96

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ the request you have sent to mock server and manage the expectations of mockserv
77

88
## How to use it
99

10-
#### WIP
11-
Write some code examples.
10+
```php
11+
//You can create expectations before call your application in a test
12+
$I->createMockRequest('{"id": "elastic-get-entity-1", "httpRequest": {...}, "httpResponse": {...}}')
13+
$I->createMockRequest('{"id": "elastic-get-entity-2", "httpRequest": {...}, "httpResponse": {...}}')
14+
$I->sendGet('/applition/endpoint/1');
15+
//After execute our application we can check our mocked HTTP communication
16+
$I->seeMockRequestWasCalled('elastic-get-entity-1');
17+
$I->seeMockRequestWasNotCalled('elastic-get-entity-2');
18+
$I->seeAllRequestWereMatched();
19+
```
1220

1321
## Installation
1422

0 commit comments

Comments
 (0)