8000 minor #53223 [Messenger] consistently use dates in UTC in Doctrine co… · symfony/symfony@12c2cc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12c2cc9

Browse files
committed
minor #53223 [Messenger] consistently use dates in UTC in Doctrine connection tests (xabbuh)
This PR was merged into the 6.3 branch. Discussion ---------- [Messenger] consistently use dates in UTC in Doctrine connection tests | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT related to #50287 and #53187 Commits ------- 10801e1 consistently use dates in UTC in Doctrine connection tests
2 parents c529c4e + 10801e1 commit 12c2cc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ public function testSendWithDelay()
7272
$stmt = $stmt->execute();
7373
}
7474

75-
$availableAt = new \DateTimeImmutable($stmt instanceof Result ? $stmt->fetchOne() : $stmt->fetchColumn());
75+
$availableAt = new \DateTimeImmutable($stmt instanceof Result ? $stmt->fetchOne() : $stmt->fetchColumn(), new \DateTimeZone('UTC'));
7676

77-
$now = new \DateTimeImmutable('now + 60 seconds');
77+
$now = new \DateTimeImmutable('now + 60 seconds', new \DateTimeZone('UTC'));
7878
$this->assertGreaterThan($now, $availableAt);
7979
}
8080

@@ -91,9 +91,9 @@ public function testSendWithNegativeDelay()
9191
// DBAL 2 compatibility
9292
$result = method_exists($qb, 'executeQuery') ? $qb->executeQuery() : $qb->execute();
9393

94-
$availableAt = new \DateTimeImmutable($result->fetchOne());
94+
$availableAt = new \DateTimeImmutable($result->fetchOne(), new \DateTimeZone('UTC'));
9595

96-
$now = new \DateTimeImmutable('now - 60 seconds');
96+
$now = new \DateTimeImmutable('now - 60 seconds', new \DateTimeZone('UTC'));
9797
$this->assertLessThan($now, $availableAt);
9898
}
9999

@@ -175,7 +175,7 @@ public function testItCountMessages()
175175
public function testItRetrieveTheMessageThatIsOlderThanRedeliverTimeout()
176176
{
177177
$this->connection->setup();
178-
$twoHoursAgo = new \DateTimeImmutable('now -2 hours');
178+
$twoHoursAgo = new \DateTimeImmutable('now -2 hours', new \DateTimeZone('UTC'));
179179
$this->driverConnection->insert('messenger_messages', [
180180
'body' => '{"message": "Hi requeued"}',
181181
'headers' => json_encode(['type' => DummyMessage::class]),

0 commit comments

Comments
 (0)
0