From 7c8aa263b809081d50c44d6305a16934e2585934 Mon Sep 17 00:00:00 2001 From: Mariano Custiel Date: Sat, 28 Oct 2017 15:49:16 +0200 Subject: [PATCH] Updated documentation --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3b985f9..649008b 100644 --- a/README.md +++ b/README.md @@ -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: