8000 [Yaml] Fix tests · symfony/symfony@25677fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 25677fe

Browse files
[Yaml] Fix tests
1 parent fe012e8 commit 25677fe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ private static function evaluateScalar($scalar, $flags, $references = array())
588588
return (float) str_replace(',', '', $scalar);
589589
case preg_match(self::getTimestampRegex(), $scalar):
590590
if (Yaml::PARSE_DATETIME & $flags) {
591-
return new \DateTime($scalar,new \DateTimeZone('UTC'));
591+
return new \DateTime($scalar, new \DateTimeZone('UTC'));
592592
}
593593

594594
$timeZone = date_default_timezone_get();

src/Symfony/Component/Yaml/Tests/InlineTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ public function testParseTimestampAsUnixTimestampByDefault($yaml, $year, $month,
495495
*/
496496
public function testParseTimestampAsDateTimeObject($yaml, $year, $month, $day, $hour, $minute, $second)
497497
{
498-
$expected = new \DateTime('now', new \DateTimeZone('UTC'));
498+
$expected = new \DateTime($yaml);
499+
$expected->setTimeZone(new \DateTimeZone('UTC'));
499500
$expected->setDate($year, $month, $day);
500501
$expected->setTime($hour, $minute, $second);
501502

0 commit comments

Comments
 (0)
0