/** * Dispatches the request to BedRest. */ public function dispatchBedRest(array $options) { if (isset($options['method'])) { $this->_bedRestRequest->setMethod($options['method']); } $restManager = $this->_bedRest->getRestManager(); $this->_bedRestResponse = $restManager->process($this->_bedRestRequest); $response = $this->getResponse(); $response->setHttpResponseCode($this->_bedRestResponse->getStatusCode()); foreach ($this->_bedRestResponse->getHeaders() as $name => $value) { $response->setHeader($name, $value); } $response->setBody($this->_bedRestResponse->getRawBody()); }
public function testContent() { $this->assertEmpty($this->response->getContent()); $body = json_encode(array('item1' => 'value1', 'item2' => 'value2', 'item3' => 'value3')); $this->response->setContent($body); $this->assertEquals($body, $this->response->getContent()); }