Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function testFormatter(): void |
||
15 | { |
||
16 | $streamFactory = new Psr17Factory(); |
||
17 | $response = new Response(); |
||
18 | $webResponse = new WebResponse(['test' => 'test'], $response, $streamFactory); |
||
19 | $formatter = new JsonResponseFormatter(new JsonSerializer()); |
||
20 | $result = $formatter->format($webResponse); |
||
21 | $result->getBody()->rewind(); |
||
22 | |||
23 | $this->assertSame('{"test":"test"}', $response->getBody()->getContents()); |
||
24 | $this->assertSame(['application/json'], $result->getHeader('Content-Type')); |
||
25 | } |
||
27 |