summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-01-15 18:46:42 +0100
committerRobin Appelman <icewind@owncloud.com>2015-01-15 18:47:05 +0100
commit0a3e0a1665f2c1faffd94ba0beb3dd2d6b0a465a (patch)
tree54bc01136b0e3095f53226772f171afffd6f870e /tests
parent2248e465afd78d51f111eeb007a0eaf38b4c9cac (diff)
downloadnextcloud-server-0a3e0a1665f2c1faffd94ba0beb3dd2d6b0a465a.tar.gz
nextcloud-server-0a3e0a1665f2c1faffd94ba0beb3dd2d6b0a465a.zip
Additional unit test for recursive remove
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/cache.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 6df98ee531d..15bcff24f36 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -143,6 +143,25 @@ class Cache extends \Test\TestCase {
$this->assertFalse($this->cache->inCache($folder.'/bar'));
}
+ public function testRemoveRecursive() {
+ $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $fileData = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain');
+ $folders = ['folder', 'folder/subfolder', 'folder/sub2', 'folder/sub2/sub3'];
+ $files = ['folder/foo.txt', 'folder/bar.txt', 'folder/subfolder/asd.txt', 'folder/sub2/qwerty.txt', 'folder/sub2/sub3/foo.txt'];
+
+ foreach($folders as $folder){
+ $this->cache->put($folder, $folderData);
+ }
+ foreach ($files as $file) {
+ $this->cache->put($file, $fileData);
+ }
+
+ $this->cache->remove('folder');
+ foreach ($files as $file) {
+ $this->assertFalse($this->cache->inCache($file));
+ }
+ }
+
public function folderDataProvider() {
return array(