summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/files/cache')
-rw-r--r--tests/lib/files/cache/cache.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index c466fbb63e7..250842805e5 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -8,6 +8,12 @@
namespace Test\Files\Cache;
+class LongId extends \OC\Files\Storage\Temporary {
+ public function getId() {
+ return 'long:' . str_repeat('foo', 50) . parent::getId();
+ }
+}
+
class Cache extends \PHPUnit_Framework_TestCase {
/**
* @var \OC\Files\Storage\Temporary $storage;
@@ -204,6 +210,15 @@ class Cache extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array($storageId, 'foo'), \OC\Files\Cache\Cache::getById($id));
}
+ function testLongId() {
+ $storage = new LongId(array());
+ $cache = $storage->getCache();
+ $storageId = $storage->getId();
+ $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+ $id = $cache->put('foo', $data);
+ $this->assertEquals(array(md5($storageId), 'foo'), \OC\Files\Cache\Cache::getById($id));
+ }
+
public function tearDown() {
$this->cache->clear();
}