| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function testThatThrowingAnExceptionWillBeCatchAndFormatted() |
||
| 36 | { |
||
| 37 | $apiAction = new ApiActionExceptionStub( |
||
| 38 | $this->getMock(RequestInterface::class), |
||
| 39 | new ResponseStub(), |
||
| 40 | [] |
||
| 41 | ); |
||
| 42 | $response = $apiAction->dispatch(); |
||
| 43 | $this->assertInstanceOf(StreamInterface::class, $response->getBody()); |
||
| 44 | $body = $response->getBody()->__toString(); |
||
| 45 | $this->assertNotEmpty($body); |
||
| 46 | $code = 500; |
||
| 47 | $jsonBody = json_decode($body); |
||
| 48 | $this->assertEquals($code, $jsonBody->code); |
||
| 49 | } |
||
| 50 | |||
| 53 |