@@ -394,6 +394,10 @@ public function testGetValues()
394394
395395 $ form = $ this ->createForm ('<form><input type="text" name="foo" value="foo" disabled="disabled" /><input type="text" name="bar" value="bar" /><input type="submit" /></form> ' );
396396 $ this ->assertEquals (array ('bar ' => 'bar ' ), $ form ->getValues (), '->getValues() does not include disabled fields ' );
397+
398+ $ form = $ this ->createForm ('<form><template><input type="text" name="foo" value="foo" /></template><input type="text" name="bar" value="bar" /><input type="submit" /></form> ' );
399+ $ this ->assertEquals (array ('bar ' => 'bar ' ), $ form ->getValues (), '->getValues() does not include template fields ' );
400+ $ this ->assertFalse ($ form ->has ('foo ' ));
397401 }
398402
399403 public function testSetValues ()
@@ -444,6 +448,10 @@ public function testGetFiles()
444448
445449 $ form = $ this ->createForm ('<form method="post"><input type="file" name="foo[bar]" disabled="disabled" /><input type="submit" /></form> ' );
446450 $ this ->assertEquals (array (), $ form ->getFiles (), '->getFiles() does not include disabled file fields ' );
451+
452+ $ form = $ this ->createForm ('<form method="post"><template><input type="file" name="foo"/></template><input type="text" name="bar" value="bar"/><input type="submit"/></form> ' );
453+ $ this ->assertEquals (array (), $ form ->getFiles (), '->getFiles() does not include template file fields ' );
454+ $ this ->assertFalse ($ form ->has ('foo ' ));
447455 }
448456
449457 public function testGetPhpFiles ()
@@ -857,7 +865,7 @@ protected function getFormFieldMock($name, $value = null)
857865 protected function createForm ($ form , $ method = null , $ currentUri = null )
858866 {
859867 $ dom = new \DOMDocument ();
860- $ dom ->loadHTML ('<html> ' .$ form .'</html> ' );
868+ @ $ dom ->loadHTML ('<html> ' .$ form .'</html> ' );
861869
862870 $ xPath = new \DOMXPath ($ dom );
863871 $ nodes = $ xPath ->query ('//input | //button ' );
0 commit comments