diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-08-26 18:50:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-26 18:50:52 +0200 |
commit | 0b652648cc698d3b5c2979ccb7f1d1544057294d (patch) | |
tree | 43e49602aee82520f57690bb952510b99466782d /tests | |
parent | 2966b503ba9eac0ff1becdeb014cf8ecc0b3660a (diff) | |
parent | 2e4cd445564ba4882ab239bbfd82b6aa800436e3 (diff) | |
download | nextcloud-server-0b652648cc698d3b5c2979ccb7f1d1544057294d.tar.gz nextcloud-server-0b652648cc698d3b5c2979ccb7f1d1544057294d.zip |
Merge pull request #6177 from nextcloud/properly-add-slo-url
Properly allow \OCP\Authentication\IApacheBackend to specify logout URL
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/TwoFactorChallengeControllerTest.php | 8 | ||||
-rw-r--r-- | tests/lib/NavigationManagerTest.php | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index bef343f9043..ed6452316ff 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -76,10 +76,10 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->session, $this->urlGenerator, ]) - ->setMethods(['getLogoutAttribute']) + ->setMethods(['getLogoutUrl']) ->getMock(); $this->controller->expects($this->any()) - ->method('getLogoutAttribute') + ->method('getLogoutUrl') ->willReturn('logoutAttribute'); } @@ -106,7 +106,7 @@ class TwoFactorChallengeControllerTest extends TestCase { 'providers' => $providers, 'backupProvider' => 'backup', 'redirect_url' => '/some/url', - 'logout_attribute' => 'logoutAttribute', + 'logout_url' => 'logoutAttribute', ], 'guest'); $this->assertEquals($expected, $this->controller->selectChallenge('/some/url')); @@ -155,7 +155,7 @@ class TwoFactorChallengeControllerTest extends TestCase { 'error' => true, 'provider' => $provider, 'backupProvider' => $backupProvider, - 'logout_attribute' => 'logoutAttribute', + 'logout_url' => 'logoutAttribute', 'template' => '<html/>', 'redirect_url' => '/re/dir/ect/url', 'error_message' => null, diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index de432e1eaf2..1d3024f0530 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -217,6 +217,16 @@ class NavigationManagerTest extends TestCase { $this->urlGenerator->expects($this->any())->method('linkToRoute')->willReturnCallback(function() { return "/apps/test/"; }); + $this->urlGenerator + ->expects($this->once()) + ->method('linkToRouteAbsolute') + ->with( + 'core.login.logout', + [ + 'requesttoken' => \OCP\Util::callRegister(), + ] + ) + ->willReturn('https://example.com/logout'); $user = $this->createMock(IUser::class); $user->expects($this->any())->method('getUID')->willReturn('user001'); $this->userSession->expects($this->any())->method('getUser')->willReturn($user); @@ -260,7 +270,7 @@ class NavigationManagerTest extends TestCase { [ 'id' => 'logout', 'order' => 99999, - 'href' => null, + 'href' => 'https://example.com/logout', 'icon' => '/apps/core/img/actions/logout.svg', 'name' => 'Log out', 'active' => false, |