summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-08-18 15:32:40 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-08-30 14:42:50 +0200
commit575589771254f898181f479f3d041f75073dfabb (patch)
tree4cd8a20f5bd307627d7c80774378e358de61153c /tests
parent245080e6477e9031fb0f904f945cd7b13a7963b7 (diff)
downloadnextcloud-server-575589771254f898181f479f3d041f75073dfabb.tar.gz
nextcloud-server-575589771254f898181f479f3d041f75073dfabb.zip
Inject \OCP\IURLGenerator to make tests work
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/NavigationManagerTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php
index 26dd452e660..f604b874961 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);
@@ -271,7 +281,7 @@ class NavigationManagerTest extends TestCase {
[
'id' => 'logout',
'order' => 99999,
- 'href' => \OC_User::getLogoutUrl(),
+ 'href' => 'https://example.com/logout',
'icon' => '/apps/core/img/actions/logout.svg',
'name' => 'Log out',
'active' => false,