File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
src/Symfony/Component/Form/Tests/Extension/Core/Type Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -259,4 +259,14 @@ public function testInitializeWithDateTime()
259
259
// to null in the type
260
260
$ this ->factory ->create ('datetime ' , new \DateTime ());
261
261
}
262
+
263
+ public function testSingleTextWidgetShouldUseTheRightInputType ()
264
+ {
265
+ $ form = $ this ->factory ->create ('datetime ' , null , array (
266
+ 'widget ' => 'single_text ' ,
267
+ ));
268
+
269
+ $ view = $ form ->createView ();
270
+ $ this ->assertEquals ('datetime ' , $ view ->get ('type ' ));
271
+ }
262
272
}
Original file line number Diff line number Diff line change @@ -536,4 +536,14 @@ public function testInitializeWithDateTime()
536
536
// to null in the type
537
537
$ this ->factory ->create ('date ' , new \DateTime ());
538
538
}
539
+
540
+ public function testSingleTextWidgetShouldUseTheRightInputType ()
541
+ {
542
+ $ form = $ this ->factory ->create ('date ' , null , array (
543
+ 'widget ' => 'single_text ' ,
544
+ ));
545
+
546
+ $ view = $ form ->createView ();
547
+ $ this ->assertEquals ('date ' , $ view ->get ('type ' ));
548
+ }
539
549
}
Original file line number Diff line number Diff line change @@ -406,4 +406,14 @@ public function testInitializeWithDateTime()
406
406
// to null in the type
407
407
$ this ->factory ->create ('time ' , new \DateTime ());
408
408
}
409
+
410
+ public function testSingleTextWidgetShouldUseTheRightInputType ()
411
+ {
412
+ $ form = $ this ->factory ->create ('time ' , null , array (
413
+ 'widget ' => 'single_text ' ,
414
+ ));
415
+
416
+ $ view = $ form ->createView ();
417
+ $ this ->assertEquals ('time ' , $ view ->get ('type ' ));
418
+ }
409
419
}
You can’t perform that action at this time.
0 commit comments