fix auth cookie tests
This commit is contained in:
parent
8bc9ef728b
commit
167096b4fe
1 changed files with 10 additions and 8 deletions
|
|
@ -48,10 +48,11 @@ class AuthMiddlewareTest extends TestCase
|
||||||
expiresAt: $this->utc('2030-08-07T12:00:00'),
|
expiresAt: $this->utc('2030-08-07T12:00:00'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$response = $this->withUnencryptedCookie(
|
$response = $this->withCredentials()
|
||||||
AuthMiddleware::COOKIE_NAME,
|
->withUnencryptedCookie(
|
||||||
'valid-token',
|
AuthMiddleware::COOKIE_NAME,
|
||||||
)->getJson('/test/authenticated-user');
|
'valid-token',
|
||||||
|
)->getJson('/test/authenticated-user');
|
||||||
|
|
||||||
$response->assertOk()->assertExactJson([
|
$response->assertOk()->assertExactJson([
|
||||||
'id' => $user->getId(),
|
'id' => $user->getId(),
|
||||||
|
|
@ -75,10 +76,11 @@ class AuthMiddlewareTest extends TestCase
|
||||||
expiresAt: $this->utc('2020-08-07T12:00:00'),
|
expiresAt: $this->utc('2020-08-07T12:00:00'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$response = $this->withUnencryptedCookie(
|
$response = $this->withCredentials()
|
||||||
AuthMiddleware::COOKIE_NAME,
|
->withUnencryptedCookie(
|
||||||
'expired-token',
|
AuthMiddleware::COOKIE_NAME,
|
||||||
)->getJson('/test/authenticated-user');
|
'expired-token',
|
||||||
|
)->getJson('/test/authenticated-user');
|
||||||
|
|
||||||
$response->assertStatus(401);
|
$response->assertStatus(401);
|
||||||
$this->assertNull(
|
$this->assertNull(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue