[Yaml] Fix tests
This commit is contained in:
parent
fe012e8abb
commit
25677febe1
@ -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();
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user