From 25677febe160d93b9c4a60541ab903c2e513f3bf Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 10 Mar 2016 15:06:18 +0100 Subject: [PATCH] [Yaml] Fix tests --- src/Symfony/Component/Yaml/Inline.php | 2 +- src/Symfony/Component/Yaml/Tests/InlineTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index b96e79cb24..2a7c649970 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -588,7 +588,7 @@ class Inline return (float) str_replace(',', '', $scalar); case preg_match(self::getTimestampRegex(), $scalar): if (Yaml::PARSE_DATETIME & $flags) { - return new \DateTime($scalar,new \DateTimeZone('UTC')); + return new \DateTime($scalar, new \DateTimeZone('UTC')); } $timeZone = date_default_timezone_get(); diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 935f6a72a8..00557ea747 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -495,7 +495,8 @@ class InlineTest extends \PHPUnit_Framework_TestCase */ public function testParseTimestampAsDateTimeObject($yaml, $year, $month, $day, $hour, $minute, $second) { - $expected = new \DateTime('now', new \DateTimeZone('UTC')); + $expected = new \DateTime($yaml); + $expected->setTimeZone(new \DateTimeZone('UTC')); $expected->setDate($year, $month, $day); $expected->setTime($hour, $minute, $second);