summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/ViewTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index 627eb71d6bf..9b435f2b935 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -1666,7 +1666,17 @@ class ViewTest extends \Test\TestCase {
$fileId = $view->getFileInfo('shareddir')->getId();
$userObject = \OC::$server->getUserManager()->createUser('test2', 'IHateNonMockableStaticClasses');
- $this->assertTrue(\OC\Share\Share::shareItem('folder', $fileId, Share::SHARE_TYPE_USER, 'test2', Constants::PERMISSION_READ));
+
+ $userFolder = \OC::$server->getUserFolder($this->user);
+ $shareDir = $userFolder->get('shareddir');
+ $shareManager = \OC::$server->getShareManager();
+ $share = $shareManager->newShare();
+ $share->setSharedWith('test2')
+ ->setSharedBy($this->user)
+ ->setShareType(\OCP\Share::SHARE_TYPE_USER)
+ ->setPermissions(\OCP\Constants::PERMISSION_READ)
+ ->setNode($shareDir);
+ $shareManager->createShare($share);
$this->assertFalse($view->rename('mount1', 'shareddir'), 'Cannot overwrite shared folder');
$this->assertFalse($view->rename('mount1', 'shareddir/sub'), 'Cannot move mount point into shared folder');