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

add test for ZF-8268

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19279 44c647ce-9c0f-0410-b52a-842ac1e357ba
stas 16 лет назад
Родитель
Сommit
cb3e6e1143
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      tests/Zend/Captcha/FigletTest.php

+ 16 - 0
tests/Zend/Captcha/FigletTest.php

@@ -114,6 +114,22 @@ class Zend_Captcha_FigletTest extends PHPUnit_Framework_TestCase
         $this->assertRegexp("/<input[^>]*?$expect/", $html, $html);
     }
 
+    /*
+     * @see ZF-8268
+     * @group ZF-8268
+     */
+    public function testLabelIdIsCorrect()
+    {
+        require_once 'Zend/Form.php';
+        $form = new Zend_Form();
+        $form->setElementsBelongTo('comment');
+        $this->element->setLabel("My Captcha");
+        $form->addElement($this->element);
+        $html = $form->render($this->getView());
+        $expect = sprintf('for="comment-%s-input"', $this->element->getName());
+        $this->assertRegexp("/<label [^>]*?$expect/", $html, $html);
+    }
+    
     public function testTimeoutPopulatedByDefault()
     {
         $ttl = $this->captcha->getTimeout();