public function testReceiveHeaders() { $received_header = null; $this->response->addEventHandler(Response::HEADER_ADDED_EVENT, function (Response $response, $header) use(&$received_header) { $received_header = $header; }); $this->response->render(); $this->assertSame(Response::JSON, $this->response->getResponseType()); $this->assertTrue($this->response->isJSON()); $this->assertSame('Content-Type: application/json', $received_header); }