public function testConstructorWithHttpResponse() { $httpResponse = new Response(); $httpResponse->setStatusCode(200); $httpResponse->getHeaders()->addHeaderLine('Content-Type', 'text/html'); $response = new CaptchaResponse($httpResponse); $this->assertSame(true, $response->getStatus()); }
public function testConstructorWithMissingStatus() { $params = array('error' => 'error'); $httpResponse = new Response(); $httpResponse->setStatusCode(200); $httpResponse->getHeaders()->addHeaderLine('Content-Type', 'text/html'); $httpResponse->setContent(json_encode($params)); $response = new CaptchaResponse($httpResponse); $this->assertSame(false, $response->getStatus()); }