diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-01-15 18:46:42 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-15 18:47:05 +0100 |
commit | 0a3e0a1665f2c1faffd94ba0beb3dd2d6b0a465a (patch) | |
tree | 54bc01136b0e3095f53226772f171afffd6f870e /tests | |
parent | 2248e465afd78d51f111eeb007a0eaf38b4c9cac (diff) | |
download | nextcloud-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.php | 19 |
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( |