Skip to content

Commit 15c9856

Browse files
authored
test: fix flaky test with new date (#285)
1 parent 0012313 commit 15c9856

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/Client/Http/RequestFactoryTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public function testParamParsed(): void
7878
new Psr17Factory(),
7979
);
8080

81+
$now = new DateTimeImmutable();
82+
$nowDate = $now->format('Y-m-d');
83+
8184
$request = $requestFactory->prepareSqlRequest(
8285
'SELECT {p1:String}, {p_2:Date}',
8386
new RequestSettings(
@@ -87,7 +90,7 @@ public function testParamParsed(): void
8790
new RequestOptions(
8891
[
8992
'p1' => 'value1',
90-
'p_2' => new DateTimeImmutable(),
93+
'p_2' => $now,
9194
],
9295
),
9396
);
@@ -101,7 +104,7 @@ public function testParamParsed(): void
101104
'Content-Disposition: form-data; name="param_p_2"',
102105
'Content-Length: 10',
103106
'',
104-
'2025-01-23',
107+
$nowDate,
105108
],
106109
),
107110
$body,

0 commit comments

Comments
 (0)