diff options
-rw-r--r-- | apps/files_sharing/lib/Cache.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 5 | ||||
-rw-r--r-- | apps/files_sharing/tests/CacheTest.php | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index bc10ddbd94f..d7dcb426d85 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -51,6 +51,8 @@ class Cache extends CacheJail { private $ownerDisplayName; + private $numericId; + /** * @param \OCA\Files_Sharing\SharedStorage $storage * @param ICacheEntry $sourceRootInfo @@ -58,6 +60,7 @@ class Cache extends CacheJail { public function __construct($storage, ICacheEntry $sourceRootInfo) { $this->storage = $storage; $this->sourceRootInfo = $sourceRootInfo; + $this->numericId = $sourceRootInfo->getStorageId(); parent::__construct( null, $this->sourceRootInfo->getPath() diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 888cbfda143..4efea477e96 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -337,6 +337,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto return $this->superShare->getNodeType(); } + /** + * @param string $path + * @param null $storage + * @return Cache + */ public function getCache($path = '', $storage = null) { if ($this->cache) { return $this->cache; diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 10db4104aae..26ba5b21e46 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -30,6 +30,8 @@ namespace OCA\Files_Sharing\Tests; +use OCA\Files_Sharing\SharedStorage; + /** * Class CacheTest * @@ -545,6 +547,7 @@ class CacheTest extends TestCase { self::loginHelper(self::TEST_FILES_SHARING_API_USER2); $this->assertTrue(\OC\Files\Filesystem::file_exists('/foo')); + /** @var SharedStorage $sharedStorage */ list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo'); $this->assertEquals($sourceStorage->getCache()->getNumericStorageId(), $sharedStorage->getCache()->getNumericStorageId()); |