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()); }
/** * 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(); }