diff options
Diffstat (limited to 'apps/files_trashbin/tests/storage.php')
-rw-r--r-- | apps/files_trashbin/tests/storage.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/files_trashbin/tests/storage.php b/apps/files_trashbin/tests/storage.php index afc07ff36c8..5c631770da3 100644 --- a/apps/files_trashbin/tests/storage.php +++ b/apps/files_trashbin/tests/storage.php @@ -261,9 +261,14 @@ class Storage extends \Test\TestCase { $recipientUser = $this->getUniqueId('recipient_'); \OC::$server->getUserManager()->createUser($recipientUser, $recipientUser); - $fileinfo = $this->userView->getFileInfo('share'); - $this->assertTrue(\OCP\Share::shareItem('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, - $recipientUser, 31)); + $node = \OC::$server->getUserFolder($this->user)->get('share'); + $share = \OC::$server->getShareManager()->newShare(); + $share->setNode($node) + ->setShareType(\OCP\Share::SHARE_TYPE_USER) + ->setSharedBy($this->user) + ->setSharedWith($recipientUser) + ->setPermissions(\OCP\Constants::PERMISSION_ALL); + \OC::$server->getShareManager()->createShare($share); $this->loginAsUser($recipientUser); @@ -309,9 +314,14 @@ class Storage extends \Test\TestCase { $recipientUser = $this->getUniqueId('recipient_'); \OC::$server->getUserManager()->createUser($recipientUser, $recipientUser); - $fileinfo = $this->userView->getFileInfo('share'); - $this->assertTrue(\OCP\Share::shareItem('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, - $recipientUser, 31)); + $node = \OC::$server->getUserFolder($this->user)->get('share'); + $share = \OC::$server->getShareManager()->newShare(); + $share->setNode($node) + ->setShareType(\OCP\Share::SHARE_TYPE_USER) + ->setSharedBy($this->user) + ->setSharedWith($recipientUser) + ->setPermissions(\OCP\Constants::PERMISSION_ALL); + \OC::$server->getShareManager()->createShare($share); $this->loginAsUser($recipientUser); |