diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-08-18 15:32:40 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-08-18 15:32:40 +0200 |
commit | 2e4cd445564ba4882ab239bbfd82b6aa800436e3 (patch) | |
tree | 9f8126ff5dde02c01f27b04ce921db26aad3ba2f /tests/lib/NavigationManagerTest.php | |
parent | a04feff9a780d77ca172ba7558a7d0cc4e01dc36 (diff) | |
download | nextcloud-server-2e4cd445564ba4882ab239bbfd82b6aa800436e3.tar.gz nextcloud-server-2e4cd445564ba4882ab239bbfd82b6aa800436e3.zip |
Inject \OCP\IURLGenerator to make tests work
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests/lib/NavigationManagerTest.php')
-rw-r--r-- | tests/lib/NavigationManagerTest.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index edab6070f9e..1d3024f0530 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); @@ -260,7 +270,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, |