From 740907101acac8fd5a707ff4085ffed7ff591e81 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 7 May 2019 22:56:44 +0200 Subject: Use non-absolute logout URL to fix wrong URL in reverse proxy scenario Signed-off-by: Morris Jobke --- tests/lib/NavigationManagerTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 8c451109ef9..c11d9f0e4de 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -217,19 +217,12 @@ class NavigationManagerTest extends TestCase { $this->urlGenerator->expects($this->any())->method('imagePath')->willReturnCallback(function ($appName, $file) { return "/apps/$appName/img/$file"; }); - $this->urlGenerator->expects($this->any())->method('linkToRoute')->willReturnCallback(function () { + $this->urlGenerator->expects($this->any())->method('linkToRoute')->willReturnCallback(function ($route) { + if ($route === 'core.login.logout') { + return 'https://example.com/logout'; + } 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); -- cgit v1.2.3