8000 minor #20408 [Yaml] set arguments depending on the PHP version (xabbuh) · symfony/symfony@172d0a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 172d0a4

Browse files
committed
minor #20408 [Yaml] set arguments depending on the PHP version (xabbuh)
This PR was merged into the 3.1 branch. Discussion ---------- [Yaml] set arguments depending on the PHP version | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- ad54d83 [Yaml] set arguments depending on the PHP version
2 parents 7301302 + ad54d83 commit 172d0a4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,12 @@ public function testParseTimestampAsDateTimeObject($yaml, $year, $month, $day, $
507507
$expected = new \DateTime($yaml);
508508
$expected->setTimeZone(new \DateTimeZone('UTC'));
509509
$expected->setDate($year, $month, $day);
510-
@$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second));
510+
511+
if (PHP_VERSION_ID >= 70100) {
512+
$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second));
513+
} else {
514+
$expected->setTime($hour, $minute, $second);
515+
}
511516

512517
$this->assertEquals($expected, Inline::parse($yaml, Yaml::PARSE_DATETIME));
513518
}

0 commit comments

Comments
 (0)
0