diff options
author | Robin Appelman <robin@icewind.nl> | 2021-01-25 17:38:34 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-01-26 15:30:54 +0100 |
commit | 5ae0be08b47d423ad5e48d84368543852f6d42e0 (patch) | |
tree | 3d6bda30b51444c383c184788c5c6194b375649d /tests | |
parent | 27f9df2e87e39a79e07b4edcbe63315403a7bed1 (diff) | |
download | nextcloud-server-5ae0be08b47d423ad5e48d84368543852f6d42e0.tar.gz nextcloud-server-5ae0be08b47d423ad5e48d84368543852f6d42e0.zip |
fix search in nested jails
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Cache/Wrapper/CacheJailTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php index de54333312b..d9f7af1f034 100644 --- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php +++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php @@ -182,4 +182,22 @@ class CacheJailTest extends CacheTest { $this->assertTrue($this->sourceCache->inCache('target/foo')); $this->assertTrue($this->sourceCache->inCache('target/foo/bar')); } + + public function testSearchNested() { + $this->storage->getScanner()->scan(''); + $file1 = 'foo'; + $file2 = 'foo/bar'; + $file3 = 'foo/bar/asd'; + $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder']; + + $this->sourceCache->put($file1, $data1); + $this->sourceCache->put($file2, $data1); + $this->sourceCache->put($file3, $data1); + + $nested = new \OC\Files\Cache\Wrapper\CacheJail($this->cache, 'bar'); + + $result = $nested->search('%asd%'); + $this->assertCount(1, $result); + $this->assertEquals('asd', $result[0]['path']); + } } |