From 15c98566af772251138ce174a100e4cbb8a7ebe7 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 27 Jan 2025 15:45:46 +0100 Subject: [PATCH] test: fix flaky test with new date (#285) --- tests/Client/Http/RequestFactoryTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Client/Http/RequestFactoryTest.php b/tests/Client/Http/RequestFactoryTest.php index cc41442..4f987e8 100644 --- a/tests/Client/Http/RequestFactoryTest.php +++ b/tests/Client/Http/RequestFactoryTest.php @@ -78,6 +78,9 @@ public function testParamParsed(): void new Psr17Factory(), ); + $now = new DateTimeImmutable(); + $nowDate = $now->format('Y-m-d'); + $request = $requestFactory->prepareSqlRequest( 'SELECT {p1:String}, {p_2:Date}', new RequestSettings( @@ -87,7 +90,7 @@ public function testParamParsed(): void new RequestOptions( [ 'p1' => 'value1', - 'p_2' => new DateTimeImmutable(), + 'p_2' => $now, ], ), ); @@ -101,7 +104,7 @@ public function testParamParsed(): void 'Content-Disposition: form-data; name="param_p_2"', 'Content-Length: 10', '', - '2025-01-23', + $nowDate, ], ), $body,