protected function _testVerifyOffline() { $adapter = new \Zend\Http\Client\Adapter\Test(); $client = new \Zend\Http\Client(null, array('adapter' => $adapter)); $this->reCaptcha->setHttpClient($client); $resp = $this->reCaptcha->verify('challengeField', 'responseField'); // See if we have a valid object and that the status is false $this->assertTrue($resp instanceof ReCaptchaResponse); $this->assertFalse($resp->getStatus()); }
public function testVerify() { $this->reCaptcha->setPublicKey($this->publicKey); $this->reCaptcha->setPrivateKey($this->privateKey); $this->reCaptcha->setIp('127.0.0.1'); $adapter = new \Zend\Http\Client\Adapter\Test(); $client = new \Zend\Http\Client(null, array('adapter' => $adapter)); $this->reCaptcha->setHttpClient($client); $resp = $this->reCaptcha->verify('challengeField', 'responseField'); // See if we have a valid object and that the status is false $this->assertTrue($resp instanceof ReCaptchaResponse); $this->assertFalse($resp->getStatus()); }