Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcustiel committed Oct 28, 2017
1 parent ef12b87 commit 7c8aa26
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,20 @@ using `${body.matchIndex}` or `${url.matchIndex}` notation.
);
$phiremock->createExpectation($expectation);
```
### Shorthand syntax for common requests
Phiremock is a bit too much expressive to create requests and that is a bit annoying when writing simple stubs. For that,
there is a simpler syntax using `Phiremock::onRequest` method.
#### Example:

```php
use Mcustiel\Phiremock\Client\Phiremock;

$phiremock = new Phiremock('phiremock.server', '8080');

$expectation = Phiremock::onRequest('get', '/my/example/url')->thenRespond(200, 'This is the response');
$phiremock->createExpectation($expectation);
```

## Appendix

### List of condition matchers:
Expand Down

0 comments on commit 7c8aa26

Please sign in to comment.