diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-05-07 22:56:44 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2019-05-08 23:38:42 +0200 |
commit | 740907101acac8fd5a707ff4085ffed7ff591e81 (patch) | |
tree | 1935440168b382b125a61ac480c75314f0d7d43e /tests | |
parent | bef84ed29b8531ab104c6d9068b3ff950f2328b1 (diff) | |
download | nextcloud-server-740907101acac8fd5a707ff4085ffed7ff591e81.tar.gz nextcloud-server-740907101acac8fd5a707ff4085ffed7ff591e81.zip |
Use non-absolute logout URL to fix wrong URL in reverse proxy scenario
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/NavigationManagerTest.php | 15 |
1 files changed, 4 insertions, 11 deletions
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); |