summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-05-07 22:56:44 +0200
committerBackportbot <backportbot-noreply@rullzer.com>2019-05-08 17:37:19 +0000
commit3ab884a47911dbe592ef0f393d9eb206e944587e (patch)
treec96093e18d68513fa0f7a2a9f063d80b2b863d9b /tests
parent26f5fffe722209654b8f4efa58985973b399c1b3 (diff)
downloadnextcloud-server-3ab884a47911dbe592ef0f393d9eb206e944587e.tar.gz
nextcloud-server-3ab884a47911dbe592ef0f393d9eb206e944587e.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.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php
index 31efbce929c..97471fa5213 100644
--- a/tests/lib/NavigationManagerTest.php
+++ b/tests/lib/NavigationManagerTest.php
@@ -217,14 +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')
- ->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);