fix auth cookie tests

This commit is contained in:
Yisroel Baum 2026-07-31 09:55:13 +03:00
parent 8bc9ef728b
commit 167096b4fe
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -48,10 +48,11 @@ class AuthMiddlewareTest extends TestCase
expiresAt: $this->utc('2030-08-07T12:00:00'),
);
$response = $this->withUnencryptedCookie(
AuthMiddleware::COOKIE_NAME,
'valid-token',
)->getJson('/test/authenticated-user');
$response = $this->withCredentials()
->withUnencryptedCookie(
AuthMiddleware::COOKIE_NAME,
'valid-token',
)->getJson('/test/authenticated-user');
$response->assertOk()->assertExactJson([
'id' => $user->getId(),
@ -75,10 +76,11 @@ class AuthMiddlewareTest extends TestCase
expiresAt: $this->utc('2020-08-07T12:00:00'),
);
$response = $this->withUnencryptedCookie(
AuthMiddleware::COOKIE_NAME,
'expired-token',
)->getJson('/test/authenticated-user');
$response = $this->withCredentials()
->withUnencryptedCookie(
AuthMiddleware::COOKIE_NAME,
'expired-token',
)->getJson('/test/authenticated-user');
$response->assertStatus(401);
$this->assertNull(