Skip to content

Commit 58affd9

Browse files
CAFernandesCopilot
andauthored
Update tests/Security/AuthMiddlewareTest.php
Co-authored-by: Copilot <[email protected]>
1 parent f225bc4 commit 58affd9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/Security/AuthMiddlewareTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ public function testJWTAuthenticationFailure(): void
7070
$request = $this->createPsrRequest(['Authorization' => 'Bearer invalid_token']);
7171
$handler = new DummyHandler();
7272

73-
$this->expectException(\PivotPHP\Core\Exceptions\HttpException::class);
74-
$this->expectExceptionMessage('Unauthorized');
75-
$middleware->process($request, $handler);
73+
try {
74+
$middleware->process($request, $handler);
75+
} catch (\PivotPHP\Core\Exceptions\HttpException $e) {
76+
$this->assertEquals('Unauthorized', $e->getMessage());
77+
}
7678
$this->assertFalse($handler->called);
7779
}
7880

0 commit comments

Comments
 (0)