@@ -345,18 +345,6 @@ public function testGetSetValue()
345345 }
346346 }
347347
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-
360348 public function testDisableValidation ()
361349 {
362350 $ form = $ this ->createForm ('<form>
@@ -681,31 +669,19 @@ public function testTypeAttributeIsCaseInsensitive()
681669 $ this ->assertTrue ($ form ->has ('example.y ' ), '->has() returns true if the image input was correctly turned into an x and a y fields ' );
682670 }
683671
684- /**
685- * @expectedException \InvalidArgumentException
686- */
687- public function testFormFieldRegistryAddThrowAnExceptionWhenTheNameIsMalformed ()
672+ public function testFormFieldRegistryAcceptAnyNames ()
688673 {
689- $ registry = new FormFieldRegistry ();
690- $ registry ->add ($ this ->getFormFieldMock ('[foo] ' ));
691- }
674+ $ field = $ this ->getFormFieldMock ('[t:dbt%3adate;]data_daterange_enddate_value ' );
692675
693- /**
694- * @expectedException \InvalidArgumentException
695- */
696- public function testFormFieldRegistryRemoveThrowAnExceptionWhenTheNameIsMalformed ()
697- {
698676 $ 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 );
701680
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 ' );
709685 }
710686
711687 /**
@@ -717,15 +693,6 @@ public function testFormFieldRegistryGetThrowAnExceptionWhenTheFieldDoesNotExist
717693 $ registry ->get ('foo ' );
718694 }
719695
720- /**
721- * @expectedException \InvalidArgumentException
722- */
723- public function testFormFieldRegistrySetThrowAnExceptionWhenTheNameIsMalformed ()
724- {
725- $ registry = new FormFieldRegistry ();
726- $ registry ->set ('[foo] ' , null );
727- }
728-
729696 /**
730697 * @expectedException \InvalidArgumentException
731698 */
0 commit comments