@@ -328,6 +328,54 @@ public function testSubmitDifferentTimezonesDuringDaylightSavingTimeUsingSingleT
328328 $ this ->assertSame ('14:09:10 ' , $ form ->getData ()->format ('H:i:s ' ));
329329 }
330330
331+ public function testSubmitWithoutSecondsAndBrowserAddingSeconds ()
332+ {
333+ $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
334+ 'model_timezone ' => 'UTC ' ,
335+ 'view_timezone ' => 'UTC ' ,
336+ 'input ' => 'string ' ,
337+ 'widget ' => 'single_text ' ,
338+ 'with_seconds ' => false ,
339+ ]);
340+
341+ $ form ->submit ('03:04:00 ' );
342+
343+ $ this ->assertEquals ('03:04:00 ' , $ form ->getData ());
344+ $ this ->assertEquals ('03:04 ' , $ form ->getViewData ());
345+ }
346+
347+ public function testSubmitWithSecondsAndBrowserAddingMicroseconds ()
348+ {
349+ $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
350+ 'model_timezone ' => 'UTC ' ,
351+ 'view_timezone ' => 'UTC ' ,
352+ 'input ' => 'string ' ,
353+ 'widget ' => 'single_text ' ,
354+ 'with_seconds ' => true ,
355+ ]);
356+
357+ $ form ->submit ('03:04:00.000 ' );
358+
359+ $ this ->assertEquals ('03:04:00 ' , $ form ->getData ());
360+ $ this ->assertEquals ('03:04:00 ' , $ form ->getViewData ());
361+ }
362+
363+ public function testSubmitWithoutSecondsAndBrowserAddingMicroseconds ()
364+ {
365+ $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
366+ 'model_timezone ' => 'UTC ' ,
367+ 'view_timezone ' => 'UTC ' ,
368+ 'input ' => 'string ' ,
369+ 'widget ' => 'single_text ' ,
370+ 'with_seconds ' => false ,
371+ ]);
372+
373+ $ form ->submit ('03:04:00.000 ' );
374+
375+ $ this ->assertEquals ('03:04:00 ' , $ form ->getData ());
376+ $ this ->assertEquals ('03:04 ' , $ form ->getViewData ());
377+ }
378+
331379 public function testSetDataWithoutMinutes ()
332380 {
333381 $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
0 commit comments