From 2e4cd445564ba4882ab239bbfd82b6aa800436e3 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 18 Aug 2017 15:32:40 +0200 Subject: Inject \OCP\IURLGenerator to make tests work Signed-off-by: Lukas Reschke --- tests/lib/NavigationManagerTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/lib/NavigationManagerTest.php') 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, -- cgit v1.2.3