File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
tests/Symfony/Tests/Component/Form/Extension/Core/DataTransformer Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -463,4 +463,52 @@ public function testReverseTransformWithInvalidDay()
463
463
'second ' => '6 ' ,
464
464
));
465
465
}
466
+
467
+ /**
468
+ * @expectedException Symfony\Component\Form\Exception\TransformationFailedException
469
+ */
470
+ public function testReverseTransformWithStringDay ()
471
+ {
472
+ $ transformer = new DateTimeToArrayTransformer ();
473
+ $ transformer ->reverseTransform (array (
474
+ 'year ' => '2010 ' ,
475
+ 'month ' => '2 ' ,
476
+ 'day ' => 'bazinga ' ,
477
+ 'hour ' => '4 ' ,
478
+ 'minute ' => '5 ' ,
479
+ 'second ' => '6 ' ,
480
+ ));
481
+ }
482
+
483
+ /**
484
+ * @expectedException Symfony\Component\Form\Exception\TransformationFailedException
485
+ */
486
+ public function testReverseTransformWithStringMonth ()
487
+ {
488
+ $ transformer = new DateTimeToArrayTransformer ();
489
+ $ transformer ->reverseTransform (array (
490
+ 'year ' => '2010 ' ,
491
+ 'month ' => 'bazinga ' ,
492
+ 'day ' => '31 ' ,
493
+ 'hour ' => '4 ' ,
494
+ 'minute ' => '5 ' ,
495
+ 'second ' => '6 ' ,
496
+ ));
497
+ }
498
+
499
+ /**
500
+ * @expectedException Symfony\Component\Form\Exception\TransformationFailedException
501
+ */
502
+ public function testReverseTransformWithStringYear ()
503
+ {
504
+ $ transformer = new DateTimeToArrayTransformer ();
505
+ $ transformer ->reverseTransform (array (
506
+ 'year ' => 'bazinga ' ,
507
+ 'month ' => '2 ' ,
508
+ 'day ' => '31 ' ,
509
+ 'hour ' => '4 ' ,
510
+ 'minute ' => '5 ' ,
511
+ 'second ' => '6 ' ,
512
+ ));
513
+ }
466
514
}
You can’t perform that action at this time.
0 commit comments