diff options
Diffstat (limited to 'apps/files_sharing/tests/ShareTest.php')
-rw-r--r-- | apps/files_sharing/tests/ShareTest.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_sharing/tests/ShareTest.php b/apps/files_sharing/tests/ShareTest.php index c1e61152e63..9b60255ed97 100644 --- a/apps/files_sharing/tests/ShareTest.php +++ b/apps/files_sharing/tests/ShareTest.php @@ -71,10 +71,14 @@ class ShareTest extends TestCase { } public function testUnshareFromSelf() { - - \OC_Group::createGroup('testGroup'); - \OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER2, 'testGroup'); - \OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER3, 'testGroup'); + $groupManager = \OC::$server->getGroupManager(); + $userManager = \OC::$server->getUserManager(); + + $testGroup = $groupManager->createGroup('testGroup'); + $user1 = $userManager->get(self::TEST_FILES_SHARING_API_USER2); + $user2 = $userManager->get(self::TEST_FILES_SHARING_API_USER3); + $testGroup->addUser($user1); + $testGroup->addUser($user2); $share1 = $this->share( \OCP\Share::SHARE_TYPE_USER, |