Skip to content

Commit c12fbf0

Browse files
committed
test: set fixed time for time-dependent tests
1 parent 18f8202 commit c12fbf0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/Authentication/HasAccessTokensTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ public function testIsTokenExpired(): void
205205
*/
206206
public function testTokenTimeToExpired(): void
207207
{
208+
Time::setTestNow('2025-07-16 12:00:00');
209+
208210
$tokenExpiration = Time::now()->addYears(1);
209211

210212
$token = $this->user->generateAccessToken('foo', ['foo.bar'], $tokenExpiration);

tests/Authentication/HasHmacTokensTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ public function testIsHmacTokenExpired(): void
214214
*/
215215
public function testHmacTokenTimeToExpired(): void
216216
{
217+
Time::setTestNow('2025-07-16 12:00:00');
218+
217219
$tokenExpiration = Time::now();
218220
$tokenExpiration = $tokenExpiration->addYears(1);
219221

0 commit comments

Comments
 (0)