|
|
|
@ -30,6 +30,18 @@ class Test_Files_Sharing_Cache extends TestCase { |
|
|
|
|
*/ |
|
|
|
|
public $user2View; |
|
|
|
|
|
|
|
|
|
/** @var \OC\Files\Cache\Cache */ |
|
|
|
|
protected $ownerCache; |
|
|
|
|
|
|
|
|
|
/** @var \OC\Files\Cache\Cache */ |
|
|
|
|
protected $sharedCache; |
|
|
|
|
|
|
|
|
|
/** @var \OC\Files\Storage\Storage */ |
|
|
|
|
protected $ownerStorage; |
|
|
|
|
|
|
|
|
|
/** @var \OC\Files\Storage\Storage */ |
|
|
|
|
protected $sharedStorage; |
|
|
|
|
|
|
|
|
|
function setUp() { |
|
|
|
|
parent::setUp(); |
|
|
|
|
|
|
|
|
@ -54,7 +66,7 @@ class Test_Files_Sharing_Cache extends TestCase { |
|
|
|
|
$this->view->file_put_contents('container/shareddir/subdir/another too.txt', $textData); |
|
|
|
|
$this->view->file_put_contents('container/shareddir/subdir/not a text file.xml', '<xml></xml>'); |
|
|
|
|
|
|
|
|
|
list($this->ownerStorage, $internalPath) = $this->view->resolvePath(''); |
|
|
|
|
list($this->ownerStorage,) = $this->view->resolvePath(''); |
|
|
|
|
$this->ownerCache = $this->ownerStorage->getCache(); |
|
|
|
|
$this->ownerStorage->getScanner()->scan(''); |
|
|
|
|
|
|
|
|
@ -72,7 +84,7 @@ class Test_Files_Sharing_Cache extends TestCase { |
|
|
|
|
|
|
|
|
|
// retrieve the shared storage |
|
|
|
|
$secondView = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2); |
|
|
|
|
list($this->sharedStorage, $internalPath) = $secondView->resolvePath('files/shareddir'); |
|
|
|
|
list($this->sharedStorage,) = $secondView->resolvePath('files/shareddir'); |
|
|
|
|
$this->sharedCache = $this->sharedStorage->getCache(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -354,7 +366,7 @@ class Test_Files_Sharing_Cache extends TestCase { |
|
|
|
|
self::loginHelper(self::TEST_FILES_SHARING_API_USER1); |
|
|
|
|
\OC\Files\Filesystem::mkdir('foo'); |
|
|
|
|
\OC\Files\Filesystem::mkdir('foo/bar'); |
|
|
|
|
\OC\Files\Filesystem::touch('foo/bar/test.txt', 'bar'); |
|
|
|
|
\OC\Files\Filesystem::touch('foo/bar/test.txt'); |
|
|
|
|
$folderInfo = \OC\Files\Filesystem::getFileInfo('foo'); |
|
|
|
|
$fileInfo = \OC\Files\Filesystem::getFileInfo('foo/bar/test.txt'); |
|
|
|
|
\OCP\Share::shareItem('folder', $folderInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL); |
|
|
|
|