diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-26 23:59:29 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-27 00:13:50 +0100 |
commit | 9e2a066c7bf04dfcc3e2dcc539e1b33053ba70ed (patch) | |
tree | 0429b7b730a1f2973c98f166b2aee02dc93be384 /tests | |
parent | 8c42e2de8c8be9bd5914794dbf01a10f575788d1 (diff) | |
download | nextcloud-server-9e2a066c7bf04dfcc3e2dcc539e1b33053ba70ed.tar.gz nextcloud-server-9e2a066c7bf04dfcc3e2dcc539e1b33053ba70ed.zip |
Cache: add function to get storage id and internal path of a file by id
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/cache.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php index 96a7623dac5..c466fbb63e7 100644 --- a/tests/lib/files/cache/cache.php +++ b/tests/lib/files/cache/cache.php @@ -197,6 +197,13 @@ class Cache extends \PHPUnit_Framework_TestCase { $this->assertEquals(array(), $this->cache->getFolderContents('foo')); } + function testGetById() { + $storageId = $this->storage->getId(); + $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'); + $id = $this->cache->put('foo', $data); + $this->assertEquals(array($storageId, 'foo'), \OC\Files\Cache\Cache::getById($id)); + } + public function tearDown() { $this->cache->clear(); } |