Beispiel #1
0
 public function testGetHtml()
 {
     $this->reCaptcha->setPublicKey($this->publicKey);
     $errorMsg = 'errorMsg';
     $this->reCaptcha->setParam('ssl', true);
     $this->reCaptcha->setParam('xhtml', true);
     $this->reCaptcha->setParam('error', $errorMsg);
     $html = $this->reCaptcha->getHtml();
     // See if the options for the captcha exist in the string
     $this->assertNotSame(false, strstr($html, 'var RecaptchaOptions = {"theme":"red","lang":"en"};'));
     // See if the js/iframe src is correct
     $this->assertNotSame(false, strstr($html, 'src="' . ReCaptcha::API_SECURE_SERVER . '/challenge?k=' . $this->publicKey . '&error=' . $errorMsg . '"'));
 }