summaryrefslogtreecommitdiffstats
path: root/tests/lib/Federation/CloudIdManagerTest.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-08-30 18:15:02 +0200
committerRobin Appelman <robin@icewind.nl>2022-08-31 15:47:00 +0200
commit1626a56ddab715e3c6af8081a9d696c74147ff79 (patch)
tree57b69d6fad632096d9c06dd890bc48dce7e7150f /tests/lib/Federation/CloudIdManagerTest.php
parentd3743392e0087c267d20db14210acba17a3ec6d2 (diff)
downloadnextcloud-server-1626a56ddab715e3c6af8081a9d696c74147ff79.tar.gz
nextcloud-server-1626a56ddab715e3c6af8081a9d696c74147ff79.zip
adjusts tests for CloudIdManager
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/Federation/CloudIdManagerTest.php')
-rw-r--r--tests/lib/Federation/CloudIdManagerTest.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/lib/Federation/CloudIdManagerTest.php b/tests/lib/Federation/CloudIdManagerTest.php
index 92f8a5fa8dd..0db36b0524a 100644
--- a/tests/lib/Federation/CloudIdManagerTest.php
+++ b/tests/lib/Federation/CloudIdManagerTest.php
@@ -22,7 +22,10 @@
namespace Test\Federation;
use OC\Federation\CloudIdManager;
+use OC\Memcache\ArrayCache;
use OCP\Contacts\IManager;
+use OCP\EventDispatcher\IEventDispatcher;
+use OCP\ICacheFactory;
use OCP\IURLGenerator;
use OCP\IUserManager;
use Test\TestCase;
@@ -36,6 +39,8 @@ class CloudIdManagerTest extends TestCase {
private $userManager;
/** @var CloudIdManager */
private $cloudIdManager;
+ /** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
+ private $cacheFactory;
protected function setUp(): void {
@@ -45,7 +50,17 @@ class CloudIdManagerTest extends TestCase {
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->userManager = $this->createMock(IUserManager::class);
- $this->cloudIdManager = new CloudIdManager($this->contactsManager, $this->urlGenerator, $this->userManager);
+ $this->cacheFactory = $this->createMock(ICacheFactory::class);
+ $this->cacheFactory->method('createLocal')
+ ->willReturn(new ArrayCache(''));
+
+ $this->cloudIdManager = new CloudIdManager(
+ $this->contactsManager,
+ $this->urlGenerator,
+ $this->userManager,
+ $this->cacheFactory,
+ $this->createMock(IEventDispatcher::class)
+ );
}
public function cloudIdProvider() {