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
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-10-30 13:41:56 +0300
committerJulius Härtl <jus@bitgrid.net>2018-10-30 13:41:56 +0300
commit5a73a9b9ded91b15ca044d27ac2cf42fb483af93 (patch)
treed18dbff8b5f0638510527b16e184b56f612b0048 /tests/lib/Collaboration
parente6952edaf450c6a74e38eac27d1de37b1934d6e3 (diff)
Fix injection to get the user id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests/lib/Collaboration')
-rw-r--r--tests/lib/Collaboration/Collaborators/RemotePluginTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/lib/Collaboration/Collaborators/RemotePluginTest.php b/tests/lib/Collaboration/Collaborators/RemotePluginTest.php
index e7639659896..aff68185767 100644
--- a/tests/lib/Collaboration/Collaborators/RemotePluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/RemotePluginTest.php
@@ -31,7 +31,9 @@ use OCP\Collaboration\Collaborators\SearchResultType;
use OCP\Contacts\IManager;
use OCP\Federation\ICloudIdManager;
use OCP\IConfig;
+use OCP\IUser;
use OCP\IUserManager;
+use OCP\IUserSession;
use OCP\Share;
use Test\TestCase;
@@ -66,7 +68,15 @@ class RemotePluginTest extends TestCase {
}
public function instantiatePlugin() {
- $this->plugin = new RemotePlugin($this->contactsManager, $this->cloudIdManager, $this->config, $this->userManager, 'admin');
+ $user = $this->createMock(IUser::class);
+ $user->expects($this->any())
+ ->method('getUID')
+ ->willReturn('admin');
+ $userSession = $this->createMock(IUserSession::class);
+ $userSession->expects($this->any())
+ ->method('getUser')
+ ->willReturn($user);
+ $this->plugin = new RemotePlugin($this->contactsManager, $this->cloudIdManager, $this->config, $this->userManager, $userSession);
}
/**