浏览代码

ZF-7813 - Adding value setter tests for Zend_Dojo's DateTextBox and TimeTextBox elements

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24460 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 14 年之前
父节点
当前提交
58fcc6b31c
共有 2 个文件被更改,包括 24 次插入0 次删除
  1. 12 0
      tests/Zend/Dojo/Form/Element/DateTextBoxTest.php
  2. 12 0
      tests/Zend/Dojo/Form/Element/TimeTextBoxTest.php

+ 12 - 0
tests/Zend/Dojo/Form/Element/DateTextBoxTest.php

@@ -196,6 +196,18 @@ class Zend_Dojo_Form_Element_DateTextBoxTest extends PHPUnit_Framework_TestCase
         $html = $this->element->render();
         $this->assertContains('dojoType="dijit.form.DateTextBox"', $html);
     }
+
+    /**
+     * @group ZF-7813
+     */
+    public function testCanSetValue()
+    {
+        $this->element->setValue('2011-05-10');
+        $html = $this->element->render();
+        
+        $this->assertSame('2011-05-10', $this->element->getValue());
+        $this->assertContains('value="2011-05-10"', $html);
+    }
 }
 
 // Call Zend_Dojo_Form_Element_DateTextBoxTest::main() if this source file is executed directly.

+ 12 - 0
tests/Zend/Dojo/Form/Element/TimeTextBoxTest.php

@@ -183,6 +183,18 @@ class Zend_Dojo_Form_Element_TimeTextBoxTest extends PHPUnit_Framework_TestCase
         $html = $this->element->render();
         $this->assertContains('dojoType="dijit.form.TimeTextBox"', $html);
     }
+
+    /**
+     * @group ZF-7813
+     */
+    public function testCanSetValue()
+    {
+        $this->element->setValue('T08:00');
+        $html = $this->element->render();
+        
+        $this->assertSame('T08:00', $this->element->getValue());
+        $this->assertContains('value="T08:00"', $html);
+    }
 }
 
 // Call Zend_Dojo_Form_Element_TimeTextBoxTest::main() if this source file is executed directly.