diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-10-30 11:41:56 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-10-30 11:41:56 +0100 |
commit | 5a73a9b9ded91b15ca044d27ac2cf42fb483af93 (patch) | |
tree | d18dbff8b5f0638510527b16e184b56f612b0048 /tests | |
parent | e6952edaf450c6a74e38eac27d1de37b1934d6e3 (diff) | |
download | nextcloud-server-5a73a9b9ded91b15ca044d27ac2cf42fb483af93.tar.gz nextcloud-server-5a73a9b9ded91b15ca044d27ac2cf42fb483af93.zip |
Fix injection to get the user id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Collaboration/Collaborators/RemotePluginTest.php | 12 |
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); } /** |