Пример #1
0
 /**
  * @covers \Recaptcher\Recaptcha::getServerUrl
  * @covers \Recaptcher\Recaptcha::getChallengeUrl
  * @covers \Recaptcher\Recaptcha::getIFrameUrl
  * @covers \Recaptcher\Recaptcha::getWidgetHtml
  */
 public function testGetWidgetHtml()
 {
     $recaptcha = new Recaptcha('123', '321');
     // options
     $options = array('theme' => 'red');
     $this->assertNotSame(false, strpos($recaptcha->getWidgetHtml($options), '<script type="text/javascript">var RecaptchaOptions = ' . json_encode($options)));
     // challenge url with lang
     $this->assertNotSame(false, strpos($recaptcha->getWidgetHtml(array('lang' => 'ru')), '<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=123&hl=ru"'));
     // iframe url
     $this->assertNotSame(false, strpos($recaptcha->getWidgetHtml(), '<iframe src="http://www.google.com/recaptcha/api/noscript?k=123"'));
 }