Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-08-12 11:46:47 +0300
committerGitHub <noreply@github.com>2016-08-12 11:46:47 +0300
commit0182b9db72d7cc3047309ccc12ea9cd92da2129b (patch)
tree120e79c56a27c219f33efeb68f03bb2baf578227 /tests
parentbbbe6a06092f5b4df8d69607a183a0352938c966 (diff)
[stable9] getJailedPath expects $path to have a trailing / (#25703) (#25738)
* getJailedPath expects $path to have a trailing / - fixes #25464 * Adding test case for getPathById including a jailed cache where root is just empty
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/wrapper/cachejail.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/lib/files/cache/wrapper/cachejail.php b/tests/lib/files/cache/wrapper/cachejail.php
index 9ddf3e9c61c..9b51b494801 100644
--- a/tests/lib/files/cache/wrapper/cachejail.php
+++ b/tests/lib/files/cache/wrapper/cachejail.php
@@ -63,8 +63,17 @@ class CacheJail extends Cache {
}
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() {