mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
test: add test for nested cache jail unjailedroot
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
0b626f5d21
commit
e5aabded60
2 changed files with 12 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ class CacheJail extends CacheWrapper {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getGetUnjailedRoot() {
|
||||
public function getGetUnjailedRoot() {
|
||||
return $this->unjailedRoot;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
namespace Test\Files\Cache\Wrapper;
|
||||
|
||||
use OC\Files\Cache\Wrapper\CacheJail;
|
||||
use OC\Files\Cache\Wrapper\CacheWrapper;
|
||||
use OC\Files\Search\SearchComparison;
|
||||
use OC\Files\Search\SearchQuery;
|
||||
use OC\Files\Storage\Wrapper\Jail;
|
||||
|
|
@ -253,4 +254,14 @@ class CacheJailTest extends CacheTest {
|
|||
$storage->getWatcher()->update('bar', ['mimetype' => 'text/plain']);
|
||||
$this->assertTrue($this->cache->inCache('bar'));
|
||||
}
|
||||
|
||||
public function testUnJailedRoot(): void {
|
||||
$jail1 = new CacheJail($this->sourceCache, 'foo');
|
||||
$jail2 = new CacheJail($jail1, 'bar');
|
||||
$this->assertEquals('foo/bar', $jail2->getGetUnjailedRoot());
|
||||
|
||||
$middleWrapper = new CacheWrapper($jail1);
|
||||
$jail3 = new CacheJail($middleWrapper, 'bar');
|
||||
$this->assertEquals('foo/bar', $jail3->getGetUnjailedRoot());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue