Просмотр исходного кода

Merge r25295 to 1.12 release branch

git-svn-id: http://framework.zend.com/svn/framework/standard/branches/release-1.12@25296 44c647ce-9c0f-0410-b52a-842ac1e357ba
frosch 12 лет назад
Родитель
Сommit
0ec8d96ccf
2 измененных файлов с 21 добавлено и 2 удалено
  1. 3 2
      library/Zend/Service/ReCaptcha.php
  2. 18 0
      tests/Zend/Captcha/ReCaptchaTest.php

+ 3 - 2
library/Zend/Service/ReCaptcha.php

@@ -103,8 +103,9 @@ class Zend_Service_ReCaptcha extends Zend_Service_Abstract
      * @var array
      */
     protected $_options = array(
-        'theme' => 'red',
-        'lang' => 'en',
+        'theme'               => 'red',
+        'lang'                => 'en',
+        'custom_translations' => array(),
     );
 
     /**

+ 18 - 0
tests/Zend/Captcha/ReCaptchaTest.php

@@ -185,6 +185,24 @@ class Zend_Captcha_ReCaptchaTest extends PHPUnit_Framework_TestCase
         $captcha = new Zend_Captcha_ReCaptcha;
         $this->assertEquals('Captcha_ReCaptcha', $captcha->getDecorator());
     }
+
+    /**
+     * @group ZF-12086
+     */
+    public function testAllowsSettingCustomTranslationsOptionOnServiceObject()
+    {
+        $options = array(
+            'instructions_visual' => 'Wpisz dwa wyrazy:',
+            'instructions_audio'  => 'Wpisz uslyszany tekst:'
+        );
+
+        $captcha = new Zend_Captcha_ReCaptcha;
+        $captcha->setOption('custom_translations', $options);
+        $this->assertEquals(
+            $options,
+            $captcha->getService()->getOption('custom_translations')
+        );
+    }
 }
 
 class Zend_Captcha_ReCaptchaTest_SessionContainer