Kaynağa Gözat

ZF-5814: do not close form tag if content is boolean false

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23926 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew 14 yıl önce
ebeveyn
işleme
4ee83c6556

+ 0 - 4
library/Zend/Dojo/View/Helper/Form.php

@@ -70,10 +70,6 @@ class Zend_Dojo_View_Helper_Form extends Zend_Dojo_View_Helper_Dijit
             $attribs['id'] = $id;
         }
 
-        if (false === $content) {
-            $content = '';
-        }
-
         $attribs = $this->_prepareDijit($attribs, array(), 'layout');
 
         return $this->getFormHelper()->form($id, $attribs, $content);

+ 6 - 0
tests/Zend/Dojo/View/Helper/FormTest.php

@@ -127,6 +127,12 @@ class Zend_Dojo_View_Helper_FormTest extends PHPUnit_Framework_TestCase
         $html = $this->helper->form('foo', array('id' => 'bar'));
         $this->assertRegexp('/<form[^>]*(id="bar")/', $html);
     }
+    
+    public function testShouldNotRenderClosingTagIfContentIsFalse()
+    {
+        $html = $this->helper->form('foo');
+        $this->assertNotRegexp('/<\/form>/', $html);
+    }
 }
 
 // Call Zend_Dojo_View_Helper_FormTest::main() if this source file is executed directly.