Fix ViewTest

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-03-16 14:59:21 +01:00 committed by Morris Jobke
parent 33b639d23c
commit 9c23c7c821
No known key found for this signature in database
GPG key ID: FE03C3A163FEDE68

View file

@ -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');