summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-05-07 22:56:44 +0200
committerMorris Jobke <hey@morrisjobke.de>2019-05-08 23:38:42 +0200
commit740907101acac8fd5a707ff4085ffed7ff591e81 (patch)
tree1935440168b382b125a61ac480c75314f0d7d43e /tests
parentbef84ed29b8531ab104c6d9068b3ff950f2328b1 (diff)
downloadnextcloud-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.php15
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);