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