summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-16 14:59:21 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-05-23 19:12:51 +0200
commit9c23c7c82198cd000c6198a86dced91451682834 (patch)
treefc382dc10e941e85e86e91d14532282abb27fc72
parent33b639d23c6d93519a6541161939e81ca5703720 (diff)
downloadnextcloud-server-9c23c7c82198cd000c6198a86dced91451682834.tar.gz
nextcloud-server-9c23c7c82198cd000c6198a86dced91451682834.zip
Fix ViewTest
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-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');