コード例 #1
0
 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());
 }
コード例 #2
0
ファイル: ResponseTest.php プロジェクト: as-sar/ZF2-NoCaptcha
 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());
 }