8000 [Form] Fixed tests failing on systems with timezones other than +01:00 · jacobmaster/symfony@655d645 · GitHub
[go: up one dir, main page]

Skip to content

Commit 655d645

Browse files
committed
[Form] Fixed tests failing on systems with timezones other than +01:00
1 parent 75dfc8f commit 655d645

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,13 +964,15 @@ public function testDateTimeWithWidgetSingleText()
964964
$form = $this->factory->createNamed('name', 'datetime', '2011-02-03 04:05:06', array(
965965
'input' => 'string',
966966
'widget' => 'single_text',
967+
'data_timezone' => 'UTC',
968+
'user_timezone' => 'UTC',
967969
));
968970

969971
$this->assertWidgetMatchesXpath($form->createView(), array(),
970972
'/input
971973
[@type="datetime"]
972974
[@name="name"]
973-
[@value="2011-02-03T04:05:06+01:00"]
975+
[@value="2011-02-03T04:05:06Z"]
974976
'
975977
);
976978
}
@@ -982,13 +984,15 @@ public function testDateTimeWithWidgetSingleTextIgnoreDateAndTimeWidgets()
982984
'date_widget' => 'choice',
983985
'time_widget' => 'choice',
984986
'widget' => 'single_text',
987+
'data_timezone' => 'UTC',
988+
'user_timezone' => 'UTC',
985989
));
986990

987991
$this->assertWidgetMatchesXpath($form->createView(), array(),
988992
'/input
989993
[@type="datetime"]
990994
[@name="name"]
991-
[@value="2011-02-03T04:05:06+01:00"]
995+
[@value="2011-02-03T04:05:06Z"]
992996
'
993997
);
994998
}

0 commit comments

Comments
 (0)
0