summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/watcher.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/watcher.php')
-rw-r--r--apps/files_sharing/tests/watcher.php34
1 files changed, 15 insertions, 19 deletions
diff --git a/apps/files_sharing/tests/watcher.php b/apps/files_sharing/tests/watcher.php
index 247fb59f351..19e1bc0b615 100644
--- a/apps/files_sharing/tests/watcher.php
+++ b/apps/files_sharing/tests/watcher.php
@@ -32,33 +32,27 @@
*/
class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
- /**
- * @var \OC\Files\Storage\Storage
- */
+ /** @var \OC\Files\Storage\Storage */
private $ownerStorage;
- /**
- * @var \OC\Files\Cache\Cache
- */
+ /** @var \OC\Files\Cache\Cache */
private $ownerCache;
- /**
- * @var \OC\Files\Storage\Storage
- */
+ /** @var \OC\Files\Storage\Storage */
private $sharedStorage;
- /**
- * @var \OC\Files\Cache\Cache
- */
+ /** @var \OC\Files\Cache\Cache */
private $sharedCache;
+ /** @var \OCP\Share\IShare */
+ private $_share;
+
protected function setUp() {
parent::setUp();
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
// prepare user1's dir structure
- $textData = "dummy file data\n";
$this->view->mkdir('container');
$this->view->mkdir('container/shareddir');
$this->view->mkdir('container/shareddir/subdir');
@@ -68,9 +62,13 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
$this->ownerStorage->getScanner()->scan('');
// share "shareddir" with user2
- $fileinfo = $this->view->getFileInfo('container/shareddir');
- \OCP\Share::shareItem('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
- self::TEST_FILES_SHARING_API_USER2, 31);
+ $this->_share = $this->share(
+ \OCP\Share::SHARE_TYPE_USER,
+ 'container/shareddir',
+ self::TEST_FILES_SHARING_API_USER1,
+ self::TEST_FILES_SHARING_API_USER2,
+ \OCP\Constants::PERMISSION_ALL
+ );
// login as user2
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
@@ -89,9 +87,7 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
if ($this->view) {
- $fileinfo = $this->view->getFileInfo('container/shareddir');
- \OCP\Share::unshare('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
- self::TEST_FILES_SHARING_API_USER2);
+ $this->shareManager->deleteShare($this->_share);
$this->view->deleteAll('container');