Skip to content

Commit 5f537a4

Browse files
author
Greg Bowler
committed
Add assertion that correct logout URI is redirected
Closes #7
1 parent 5a66aa6 commit 5f537a4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/phpunit/AuthenticatorTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Authwave\NotLoggedInException;
77
use Authwave\ProviderUri\AdminUri;
88
use Authwave\ProviderUri\AuthUri;
9+
use Authwave\ProviderUri\LogoutUri;
910
use Authwave\RedirectHandler;
1011
use Authwave\SessionData;
1112
use Authwave\SessionNotStartedException;
@@ -73,6 +74,12 @@ public function testLogoutClearsSession() {
7374
];
7475

7576
$redirectHandler = self::createMock(RedirectHandler::class);
77+
$redirectHandler->expects(self::once())
78+
->method("redirect")
79+
->with(self::callback(fn(UriInterface $uri) =>
80+
$uri->getHost() === AuthUri::DEFAULT_BASE_REMOTE_URI
81+
&& $uri->getPath() === LogoutUri::PATH_LOGOUT
82+
));
7683

7784
$sut = new Authenticator(
7885
"example-app-id",

0 commit comments

Comments
 (0)