@@ -394,6 +394,10 @@ public function testGetValues()
394
394
395
395
$ form = $ this ->createForm ('<form><input type="text" name="foo" value="foo" disabled="disabled" /><input type="text" name="bar" value="bar" /><input type="submit" /></form> ' );
396
396
$ 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 ' ));
397
401
}
398
402
399
403
public function testSetValues ()
@@ -444,6 +448,10 @@ public function testGetFiles()
444
448
445
449
$ form = $ this ->createForm ('<form method="post"><input type="file" name="foo[bar]" disabled="disabled" /><input type="submit" /></form> ' );
446
450
$ 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 ' ));
447
455
}
448
456
449
457
public function testGetPhpFiles ()
@@ -857,7 +865,7 @@ protected function getFormFieldMock($name, $value = null)
857
865
protected function createForm ($ form , $ method = null , $ currentUri = null )
858
866
{
859
867
$ dom = new \DOMDocument ();
860
- $ dom ->loadHTML ('<html> ' .$ form .'</html> ' );
868
+ @ $ dom ->loadHTML ('<html> ' .$ form .'</html> ' );
861
869
862
870
$ xPath = new \DOMXPath ($ dom );
863
871
$ nodes = $ xPath ->query ('//input | //button ' );
0 commit comments