| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function testFormat(Response $response): void |
||
| 26 | { |
||
| 27 | $formater = new Formatter(); |
||
| 28 | $formater->format($response); |
||
| 29 | $this->assertSame('application/json; charset=UTF-8', $response->getHeaders()->get('Content-Type')); |
||
| 30 | if ($response->data instanceof PayloadInterface) { |
||
| 31 | $data = $response->data->toArray(); |
||
| 32 | } else { |
||
| 33 | $data = $response->data; |
||
| 34 | } |
||
| 35 | $this->assertSame(json_encode($data, $formater->getOptions()), $response->content); |
||
| 36 | } |
||
| 49 |