diff --git a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php index 7c7ad221dbebb..e5f702ba5dd54 100644 --- a/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php @@ -72,9 +72,9 @@ public function testSendWithDelay() $stmt = $stmt->execute(); } - $availableAt = new \DateTimeImmutable($stmt instanceof Result ? $stmt->fetchOne() : $stmt->fetchColumn()); + $availableAt = new \DateTimeImmutable($stmt instanceof Result ? $stmt->fetchOne() : $stmt->fetchColumn(), new \DateTimeZone('UTC')); - $now = new \DateTimeImmutable('now + 60 seconds'); + $now = new \DateTimeImmutable('now + 60 seconds', new \DateTimeZone('UTC')); $this->assertGreaterThan($now, $availableAt); } @@ -91,9 +91,9 @@ public function testSendWithNegativeDelay() // DBAL 2 compatibility $result = method_exists($qb, 'executeQuery') ? $qb->executeQuery() : $qb->execute(); - $availableAt = new \DateTimeImmutable($result->fetchOne()); + $availableAt = new \DateTimeImmutable($result->fetchOne(), new \DateTimeZone('UTC')); - $now = new \DateTimeImmutable('now - 60 seconds'); + $now = new \DateTimeImmutable('now - 60 seconds', new \DateTimeZone('UTC')); $this->assertLessThan($now, $availableAt); } @@ -175,7 +175,7 @@ public function testItCountMessages() public function testItRetrieveTheMessageThatIsOlderThanRedeliverTimeout() { $this->connection->setup(); - $twoHoursAgo = new \DateTimeImmutable('now -2 hours'); + $twoHoursAgo = new \DateTimeImmutable('now -2 hours', new \DateTimeZone('UTC')); $this->driverConnection->insert('messenger_messages', [ 'body' => '{"message": "Hi requeued"}', 'headers' => json_encode(['type' => DummyMessage::class]),