public function testFromResponseObj()
 {
     $httpResponse = new Response();
     $httpResponse->setStatusCode(200);
     $httpResponse->getHeaders()->addHeaderLine('Content-Type', 'text/html');
     $this->response->setFromResponseObj($httpResponse);
     $this->assertSame(true, $this->response->getStatus());
 }
Example #2
0
 public function testFromResponseObj()
 {
     $params = array('success' => true, 'error' => 'error');
     $httpResponse = new Response();
     $httpResponse->setStatusCode(200);
     $httpResponse->getHeaders()->addHeaderLine('Content-Type', 'text/html');
     $httpResponse->setContent(json_encode($params));
     $this->response->setFromResponseObj($httpResponse);
     $this->assertSame(true, $this->response->getStatus());
     $this->assertSame($params['error'], $this->response->getError());
 }