@@ -239,6 +239,54 @@ public function testSubmitWithSecondsAndBrowserOmissionSeconds()
239239 $ this ->assertEquals ('03:04:00 ' , $ form ->getViewData ());
240240 }
241241
242+ public function testSubmitWithoutSecondsAndBrowserAddingSeconds ()
243+ {
244+ $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
245+ 'model_timezone ' => 'UTC ' ,
246+ 'view_timezone ' => 'UTC ' ,
247+ 'input ' => 'string ' ,
248+ 'widget ' => 'single_text ' ,
249+ 'with_seconds ' => false ,
250+ ]);
251+
252+ $ form ->submit ('03:04:00 ' );
253+
254+ $ this ->assertEquals ('03:04:00 ' , $ form ->getData ());
255+ $ this ->assertEquals ('03:04 ' , $ form ->getViewData ());
256+ }
257+
258+ public function testSubmitWithSecondsAndBrowserAddingMicroseconds ()
259+ {
260+ $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
261+ 'model_timezone ' => 'UTC ' ,
262+ 'view_timezone ' => 'UTC ' ,
263+ 'input ' => 'string ' ,
264+ 'widget ' => 'single_text ' ,
265+ 'with_seconds ' => true ,
266+ ]);
267+
268+ $ form ->submit ('03:04:00.000 ' );
269+
270+ $ this ->assertEquals ('03:04:00 ' , $ form ->getData ());
271+ $ this ->assertEquals ('03:04:00 ' , $ form ->getViewData ());
272+ }
273+
274+ public function testSubmitWithoutSecondsAndBrowserAddingMicroseconds ()
275+ {
276+ $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
277+ 'model_timezone ' => 'UTC ' ,
278+ 'view_timezone ' => 'UTC ' ,
279+ 'input ' => 'string ' ,
280+ 'widget ' => 'single_text ' ,
281+ 'with_seconds ' => false ,
282+ ]);
283+
284+ $ form ->submit ('03:04:00.000 ' );
285+
286+ $ this ->assertEquals ('03:04:00 ' , $ form ->getData ());
287+ $ this ->assertEquals ('03:04 ' , $ form ->getViewData ());
288+ }
289+
242290 public function testSetDataWithoutMinutes ()
243291 {
244292 $ form = $ this ->factory ->create (static ::TESTED_TYPE , null , [
0 commit comments