From 7179002600ccde6d6757c068c9388430ed71a2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 9 Jul 2021 08:00:03 +0200 Subject: Allow to get a local cloud id without going through the contacts manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/federatedfilesharing/tests/AddressHandlerTest.php | 3 ++- .../tests/Controller/MountPublicLinkControllerTest.php | 3 ++- apps/federatedfilesharing/tests/FederatedShareProviderTest.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/federatedfilesharing') diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php index f21d29ebd7e..13030e73cb0 100644 --- a/apps/federatedfilesharing/tests/AddressHandlerTest.php +++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php @@ -32,6 +32,7 @@ use OCA\FederatedFileSharing\AddressHandler; use OCP\Contacts\IManager; use OCP\IL10N; use OCP\IURLGenerator; +use OCP\IUserManager; class AddressHandlerTest extends \Test\TestCase { /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ @@ -59,7 +60,7 @@ class AddressHandlerTest extends \Test\TestCase { $this->contactsManager = $this->createMock(IManager::class); - $this->cloudIdManager = new CloudIdManager($this->contactsManager); + $this->cloudIdManager = new CloudIdManager($this->contactsManager, $this->urlGenerator, $this->createMock(IUserManager::class)); $this->addressHandler = new AddressHandler($this->urlGenerator, $this->il10n, $this->cloudIdManager); } diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php index d3a87a4c416..ff979c23d2a 100644 --- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php @@ -41,6 +41,7 @@ use OCP\Http\Client\IClientService; use OCP\IL10N; use OCP\IRequest; use OCP\ISession; +use OCP\IURLGenerator; use OCP\IUserManager; use OCP\IUserSession; use OCP\Share\IManager; @@ -106,7 +107,7 @@ class MountPublicLinkControllerTest extends \Test\TestCase { $this->userSession = $this->getMockBuilder(IUserSession::class)->disableOriginalConstructor()->getMock(); $this->clientService = $this->getMockBuilder('OCP\Http\Client\IClientService')->disableOriginalConstructor()->getMock(); $this->contactsManager = $this->createMock(IContactsManager::class); - $this->cloudIdManager = new CloudIdManager($this->contactsManager); + $this->cloudIdManager = new CloudIdManager($this->contactsManager, $this->createMock(IURLGenerator::class), $this->userManager); $this->controller = new MountPublicLinkController( 'federatedfilesharing', $this->request, diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php index a3253323769..831b9b59b54 100644 --- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php +++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php @@ -46,6 +46,7 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; use OCP\ILogger; +use OCP\IURLGenerator; use OCP\IUserManager; use OCP\Share\IManager; use OCP\Share\IShare; @@ -115,7 +116,7 @@ class FederatedShareProviderTest extends \Test\TestCase { //$this->addressHandler = new AddressHandler(\OC::$server->getURLGenerator(), $this->l); $this->addressHandler = $this->getMockBuilder('OCA\FederatedFileSharing\AddressHandler')->disableOriginalConstructor()->getMock(); $this->contactsManager = $this->createMock(IContactsManager::class); - $this->cloudIdManager = new CloudIdManager($this->contactsManager); + $this->cloudIdManager = new CloudIdManager($this->contactsManager, $this->createMock(IURLGenerator::class), $this->userManager); $this->gsConfig = $this->createMock(\OCP\GlobalScale\IConfig::class); $this->userManager->expects($this->any())->method('userExists')->willReturn(true); -- cgit v1.2.3