summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-08-09 11:04:11 +0200
committerGitHub <noreply@github.com>2016-08-09 11:04:11 +0200
commitb4ed4e152e9853fe85492b10986f9923e703da73 (patch)
tree250c4a54c121bc4d1e3fe25083d0b6cdf179ff87 /tests
parent4277051442c2b6025da936493cb674dcf754d34c (diff)
parentf1cd68d71337d3419ea7fced7304bc2a763d29d4 (diff)
downloadnextcloud-server-b4ed4e152e9853fe85492b10986f9923e703da73.tar.gz
nextcloud-server-b4ed4e152e9853fe85492b10986f9923e703da73.zip
Merge pull request #746 from nextcloud/jail-root
getJailedPath expects $path to have a trailing /
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/Cache/Wrapper/CacheJailTest.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
index 6ef6716f721..e3043c50d57 100644
--- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
+++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
@@ -63,8 +63,17 @@ class CacheJailTest extends CacheTest {
}
function testGetById() {
- //not supported
- $this->assertTrue(true);
+ $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $id = $this->sourceCache->put('foo/bar', $data1);
+
+ // path from jailed foo of foo/bar is bar
+ $path = $this->cache->getPathById($id);
+ $this->assertEquals('bar', $path);
+
+ // path from jailed '' of foo/bar is foo/bar
+ $this->cache = new \OC\Files\Cache\Wrapper\CacheJail($this->sourceCache, '');
+ $path = $this->cache->getPathById($id);
+ $this->assertEquals('foo/bar', $path);
}
function testGetIncomplete() {