@@ -345,18 +345,6 @@ public function testGetSetValue()
345
345
}
346
346
}
347
347
348
- public function testSetValueOnMultiValuedFieldsWithMalformedName ()
349
- {
350
- $ form = $ this ->createForm ('<form><input type="text" name="foo[bar]" value="bar" /><input type="text" name="foo[baz]" value="baz" /><input type="submit" /></form> ' );
351
-
352
- try {
353
- $ form ['foo[bar ' ] = 'bar ' ;
354
- $ this ->fail ('->offsetSet() throws an \InvalidArgumentException exception if the name is malformed. ' );
355
- } catch (\InvalidArgumentException $ e ) {
356
- $ this ->assertTrue (true , '->offsetSet() throws an \InvalidArgumentException exception if the name is malformed. ' );
357
- }
358
- }
359
-
360
348
public function testDisableValidation ()
361
349
{
362
350
$ form = $ this ->createForm ('<form>
@@ -681,31 +669,19 @@ public function testTypeAttributeIsCaseInsensitive()
681
669
$ this ->assertTrue ($ form ->has ('example.y
6D40
span>' ), '->has() returns true if the image input was correctly turned into an x and a y fields ' );
682
670
}
683
671
684
- /**
685
- * @expectedException \InvalidArgumentException
686
- */
687
- public function testFormFieldRegistryAddThrowAnExceptionWhenTheNameIsMalformed ()
672
+ public function testFormFieldRegistryAcceptAnyNames ()
688
673
{
689
- $ registry = new FormFieldRegistry ();
690
- $ registry ->add ($ this ->getFormFieldMock ('[foo] ' ));
691
- }
674
+ $ field = $ this ->getFormFieldMock ('[t:dbt%3adate;]data_daterange_enddate_value ' );
692
675
693
- /**
694
- * @expectedException \InvalidArgumentException
695
- */
696
- public function testFormFieldRegistryRemoveThrowAnExceptionWhenTheNameIsMalformed ()
697
- {
698
676
$ registry = new FormFieldRegistry ();
699
- $ registry ->remove ('[foo] ' );
700
- }
677
+ $ registry ->add ($ field );
678
+ $ this ->assertEquals ($ field , $ registry ->get ('[t:dbt%3adate;]data_daterange_enddate_value ' ));
679
+ $ registry ->set ('[t:dbt%3adate;]data_daterange_enddate_value ' , null );
701
680
702
- /**
703
- * @expectedException \InvalidArgumentException
704
- */
705
- public function testFormFieldRegistryGetThrowAnExceptionWhenTheNameIsMalformed ()
706
- {
707
- $ registry = new FormFieldRegistry ();
708
- $ registry ->get ('[foo] ' );
681
+ $ form = $ this ->createForm ('<form><input type="text" name="[t:dbt%3adate;]data_daterange_enddate_value" value="bar" /><input type="submit" /></form> ' );
682
+ $ form ['[t:dbt%3adate;]data_daterange_enddate_value ' ] = 'bar ' ;
683
+
684
+ $ registry ->remove ('[t:dbt%3adate;]data_daterange_enddate_value ' );
709
685
}
710
686
711
687
/**
@@ -717,15 +693,6 @@ public function testFormFieldRegistryGetThrowAnExceptionWhenTheFieldDoesNotExist
717
693
$ registry ->get ('foo ' );
718
694
}
719
695
720
- /**
721
- * @expectedException \InvalidArgumentException
722
- */
723
- public function testFormFieldRegistrySetThrowAnExceptionWhenTheNameIsMalformed ()
724
- {
725
- $ registry = new FormFieldRegistry ();
726
- $ registry ->set ('[foo] ' , null );
727
- }
728
-
729
696
/**
730
697
* @expectedException \InvalidArgumentException
731
698
*/
0 commit comments