aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/CacheTest.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2017-02-16 11:47:16 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-03-23 00:02:48 -0600
commit89c42a76c34aba7dd4c23649f97495283cf023ba (patch)
tree4252d22cb431a00f8dcda5d52e0080d1fdff16d8 /apps/files_sharing/tests/CacheTest.php
parent39ac804899197069b40384afdc40966e22658eca (diff)
downloadnextcloud-server-89c42a76c34aba7dd4c23649f97495283cf023ba.tar.gz
nextcloud-server-89c42a76c34aba7dd4c23649f97495283cf023ba.zip
Remove SharedCache::getNumericStorageId to let CacheWrapper do it
The CacheWrapper will properly forward the call to the wrapped cache. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/tests/CacheTest.php')
-rw-r--r--apps/files_sharing/tests/CacheTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php
index ae0247a84e2..10db4104aae 100644
--- a/apps/files_sharing/tests/CacheTest.php
+++ b/apps/files_sharing/tests/CacheTest.php
@@ -525,4 +525,28 @@ class CacheTest extends TestCase {
$this->assertEquals('', $sharedCache->getPathById($folderInfo->getId()));
$this->assertEquals('bar/test.txt', $sharedCache->getPathById($fileInfo->getId()));
}
+
+ public function testNumericStorageId() {
+ self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
+ \OC\Files\Filesystem::mkdir('foo');
+
+ $rootFolder = \OC::$server->getUserFolder(self::TEST_FILES_SHARING_API_USER1);
+ $node = $rootFolder->get('foo');
+ $share = $this->shareManager->newShare();
+ $share->setNode($node)
+ ->setShareType(\OCP\Share::SHARE_TYPE_USER)
+ ->setSharedWith(self::TEST_FILES_SHARING_API_USER2)
+ ->setSharedBy(self::TEST_FILES_SHARING_API_USER1)
+ ->setPermissions(\OCP\Constants::PERMISSION_ALL);
+ $this->shareManager->createShare($share);
+ \OC_Util::tearDownFS();
+
+ list($sourceStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER1 . '/files/foo');
+
+ self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
+ $this->assertTrue(\OC\Files\Filesystem::file_exists('/foo'));
+ list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo');
+
+ $this->assertEquals($sourceStorage->getCache()->getNumericStorageId(), $sharedStorage->getCache()->getNumericStorageId());
+ }
}