Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-08-30 19:15:02 +0300
committerRobin Appelman <robin@icewind.nl>2022-08-31 16:47:00 +0300
commit1626a56ddab715e3c6af8081a9d696c74147ff79 (patch)
tree57b69d6fad632096d9c06dd890bc48dce7e7150f /apps
parentd3743392e0087c267d20db14210acba17a3ec6d2 (diff)
adjusts tests for CloudIdManagercloudid-cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/federatedfilesharing/tests/AddressHandlerTest.php10
-rw-r--r--apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php10
-rw-r--r--apps/federatedfilesharing/tests/FederatedShareProviderTest.php10
-rw-r--r--apps/files_sharing/tests/External/CacheTest.php10
-rw-r--r--apps/files_sharing/tests/External/ManagerTest.php12
5 files changed, 44 insertions, 8 deletions
diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php
index 13030e73cb0..de0a8d259c1 100644
--- a/apps/federatedfilesharing/tests/AddressHandlerTest.php
+++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php
@@ -30,9 +30,11 @@ namespace OCA\FederatedFileSharing\Tests;
use OC\Federation\CloudIdManager;
use OCA\FederatedFileSharing\AddressHandler;
use OCP\Contacts\IManager;
+use OCP\ICacheFactory;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUserManager;
+use OCP\EventDispatcher\IEventDispatcher;
class AddressHandlerTest extends \Test\TestCase {
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
@@ -60,7 +62,13 @@ class AddressHandlerTest extends \Test\TestCase {
$this->contactsManager = $this->createMock(IManager::class);
- $this->cloudIdManager = new CloudIdManager($this->contactsManager, $this->urlGenerator, $this->createMock(IUserManager::class));
+ $this->cloudIdManager = new CloudIdManager(
+ $this->contactsManager,
+ $this->urlGenerator,
+ $this->createMock(IUserManager::class),
+ $this->createMock(ICacheFactory::class),
+ $this->createMock(IEventDispatcher::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 ff979c23d2a..b04b7810910 100644
--- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php
+++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php
@@ -34,10 +34,12 @@ use OCA\FederatedFileSharing\Controller\MountPublicLinkController;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCP\AppFramework\Http;
use OCP\Contacts\IManager as IContactsManager;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudIdManager;
use OCP\Files\IRootFolder;
use OCP\HintException;
use OCP\Http\Client\IClientService;
+use OCP\ICacheFactory;
use OCP\IL10N;
use OCP\IRequest;
use OCP\ISession;
@@ -107,7 +109,13 @@ 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->createMock(IURLGenerator::class), $this->userManager);
+ $this->cloudIdManager = new CloudIdManager(
+ $this->contactsManager,
+ $this->createMock(IURLGenerator::class),
+ $this->userManager,
+ $this->createMock(ICacheFactory::class),
+ $this->createMock(IEventDispatcher::class)
+ );
$this->controller = new MountPublicLinkController(
'federatedfilesharing', $this->request,
diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
index 7d9b2486080..797d029d6b1 100644
--- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
+++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php
@@ -38,10 +38,12 @@ use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\FederatedFileSharing\Notifications;
use OCA\FederatedFileSharing\TokenHandler;
use OCP\Contacts\IManager as IContactsManager;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudIdManager;
use OCP\Files\File;
use OCP\Files\IRootFolder;
+use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IL10N;
@@ -116,7 +118,13 @@ 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->createMock(IURLGenerator::class), $this->userManager);
+ $this->cloudIdManager = new CloudIdManager(
+ $this->contactsManager,
+ $this->createMock(IURLGenerator::class),
+ $this->userManager,
+ $this->createMock(ICacheFactory::class),
+ $this->createMock(IEventDispatcher::class)
+ );
$this->gsConfig = $this->createMock(\OCP\GlobalScale\IConfig::class);
$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
diff --git a/apps/files_sharing/tests/External/CacheTest.php b/apps/files_sharing/tests/External/CacheTest.php
index c538f7dd760..c77012c3e44 100644
--- a/apps/files_sharing/tests/External/CacheTest.php
+++ b/apps/files_sharing/tests/External/CacheTest.php
@@ -30,7 +30,9 @@ namespace OCA\Files_Sharing\Tests\External;
use OC\Federation\CloudIdManager;
use OCA\Files_Sharing\Tests\TestCase;
use OCP\Contacts\IManager;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudIdManager;
+use OCP\ICacheFactory;
use OCP\IURLGenerator;
use OCP\IUserManager;
@@ -68,7 +70,13 @@ class CacheTest extends TestCase {
$this->contactsManager = $this->createMock(IManager::class);
- $this->cloudIdManager = new CloudIdManager($this->contactsManager, $this->createMock(IURLGenerator::class), $this->createMock(IUserManager::class));
+ $this->cloudIdManager = new CloudIdManager(
+ $this->contactsManager,
+ $this->createMock(IURLGenerator::class),
+ $this->createMock(IUserManager::class),
+ $this->createMock(ICacheFactory::class),
+ $this->createMock(IEventDispatcher::class)
+ );
$this->remoteUser = $this->getUniqueID('remoteuser');
$this->storage = $this->getMockBuilder('\OCA\Files_Sharing\External\Storage')
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php
index 0b35e08da2d..86386144932 100644
--- a/apps/files_sharing/tests/External/ManagerTest.php
+++ b/apps/files_sharing/tests/External/ManagerTest.php
@@ -31,21 +31,19 @@
namespace OCA\Files_Sharing\Tests\External;
use OC\Federation\CloudIdManager;
-use OC\Files\SetupManager;
use OC\Files\SetupManagerFactory;
use OC\Files\Storage\StorageFactory;
use OCA\Files_Sharing\External\Manager;
use OCA\Files_Sharing\External\MountProvider;
use OCA\Files_Sharing\Tests\TestCase;
use OCP\Contacts\IManager;
-use OCP\Diagnostics\IEventLogger;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProviderManager;
-use OCP\Files\Config\IMountProviderCollection;
use OCP\Files\NotFoundException;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
+use OCP\ICacheFactory;
use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IURLGenerator;
@@ -130,7 +128,13 @@ class ManagerTest extends TestCase {
$this->testMountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function () {
return $this->manager;
- }, new CloudIdManager($this->contactsManager, $this->createMock(IURLGenerator::class), $this->userManager));
+ }, new CloudIdManager(
+ $this->contactsManager,
+ $this->createMock(IURLGenerator::class),
+ $this->userManager,
+ $this->createMock(ICacheFactory::class),
+ $this->createMock(IEventDispatcher::class)
+ ));
$group1 = $this->createMock(IGroup::class);
$group1->expects($this->any())->method('getGID')->willReturn('group1');