Пример #1
0
 public function testVerifyWithMissingResponseField()
 {
     $this->setExpectedException('Zend\\Service\\ReCaptcha\\Exception');
     $this->reCaptcha->setPrivateKey($this->privateKey);
     $this->reCaptcha->setIp('127.0.0.1');
     $this->reCaptcha->verify('challenge', '');
 }
 public function testVerifyWithMissingResponseField()
 {
     $this->reCaptcha->setPrivateKey($this->privateKey);
     $this->reCaptcha->setIp('127.0.0.1');
     $response = $this->reCaptcha->verify('challenge', '');
     $this->assertFalse($response->getStatus());
 }
Пример #3
0
 /**
  * Override the setPrivateKey method
  *
  * Override the parent method to store a binary representation of the private key as well.
  *
  * @param string $privateKey
  * @return \ZendService\ReCaptcha\MailHide
  */
 public function setPrivateKey($privateKey)
 {
     parent::setPrivateKey($privateKey);
     /* Pack the private key into a binary string */
     $this->privateKeyPacked = pack('H*', $this->privateKey);
     return $this;
 }