| @@ 34-46 (lines=13) @@ | ||
| 31 | $this->match($request, $responseConfig)->shouldReturn(true); |
|
| 32 | } |
|
| 33 | ||
| 34 | function it_match_when_request_body_match_config_body() |
|
| 35 | { |
|
| 36 | $responseConfig = Element::fromArray([ |
|
| 37 | 'request' => [ |
|
| 38 | 'path' => '/foo', |
|
| 39 | 'headers' => [], |
|
| 40 | 'body' => 'HELLO WORLD' |
|
| 41 | ], |
|
| 42 | ]); |
|
| 43 | $request = Request::create('/foo', 'GET', [], [], [], [], 'HELLO WORLD'); |
|
| 44 | ||
| 45 | $this->match($request, $responseConfig)->shouldReturn(true); |
|
| 46 | } |
|
| 47 | ||
| 48 | function it_not_match_when_request_body_not_match_config_body() |
|
| 49 | { |
|
| @@ 48-60 (lines=13) @@ | ||
| 45 | $this->match($request, $responseConfig)->shouldReturn(true); |
|
| 46 | } |
|
| 47 | ||
| 48 | function it_not_match_when_request_body_not_match_config_body() |
|
| 49 | { |
|
| 50 | $responseConfig = Element::fromArray([ |
|
| 51 | 'request' => [ |
|
| 52 | 'path' => '/foo', |
|
| 53 | 'headers' => [], |
|
| 54 | 'body' => 'HELLO WORLD' |
|
| 55 | ], |
|
| 56 | ]); |
|
| 57 | $request = Request::create('/foo', 'GET', [], [], [], [], 'WORLD HELLO'); |
|
| 58 | ||
| 59 | $this->match($request, $responseConfig)->shouldReturn(false); |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||