Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | public function testToResponse() |
||
17 | { |
||
18 | $data = ['something' => 'test']; |
||
19 | $resp = new BaseJsonResponse(); |
||
20 | $property = self::getNonPublicProperty($resp, 'data'); |
||
21 | $property->setValue($resp, $data); |
||
22 | $ret = $resp->toResponse(); |
||
23 | $this->assertInstanceOf(Response::class, $ret); |
||
24 | $this->assertEquals(200, $ret->getStatusCode()); |
||
25 | $this->assertEquals(json_encode($data), $ret->getContent()); |
||
26 | $this->assertEquals('application/json', $ret->headers->get('Content-Type')); |
||
27 | } |
||
28 | } |
||
29 |