Exemplo n.º 1
0
 public function testSetAndGetPublicAndPrivateKeys()
 {
     $captcha = new ReCaptcha();
     $pubKey = 'pubKey';
     $privKey = 'privKey';
     $captcha->setPubkey($pubKey)->setPrivkey($privKey);
     $this->assertSame($pubKey, $captcha->getPubkey());
     $this->assertSame($privKey, $captcha->getPrivkey());
     $this->assertSame($pubKey, $captcha->getService()->getPublicKey());
     $this->assertSame($privKey, $captcha->getService()->getPrivateKey());
 }
Exemplo n.º 2
0
 /**
  * Configuration options that are needed to render a specific captcha.
  *
  * For example this captcha needs to expose its public key.
  *
  * @return array
  */
 public function options()
 {
     return ['host' => ReCaptchaService::API_SERVER, 'public_key' => $this->reCaptcha->getPubkey()];
 }
 function it_should_get_the_configured_public_key(ReCaptcha $captcha)
 {
     $this->options();
     $captcha->getPubkey()->shouldHaveBeenCalled();
 }