summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-01-27 15:45:19 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-29 13:06:59 +0100
commitec3f6549f6223a9fb752c5a930549c5c1fe7bcc6 (patch)
treecbc54cd66341e1fd159d6d94b2d08a64de8bfc4a /tests
parent308396b770f3b1b41ba31ff0ee889d485b14d14a (diff)
downloadnextcloud-server-ec3f6549f6223a9fb752c5a930549c5c1fe7bcc6.tar.gz
nextcloud-server-ec3f6549f6223a9fb752c5a930549c5c1fe7bcc6.zip
Add fallback moveFromCache implementation
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/cache.php4
-rw-r--r--tests/lib/files/cache/movefromcachetraittest.php31
2 files changed, 33 insertions, 2 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index de4ae9cd8e9..54aa7ad789a 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -641,8 +641,8 @@ class Cache extends \Test\TestCase {
$this->cache->put($name, $folderData);
$this->cache->put('other', $folderData);
$childs = ['asd', 'bar', 'foo', 'sub/folder'];
- $this->cache->put($name . '/sub/folder', $folderData);
- $this->cache->put('other/sub/folder', $folderData);
+ $this->cache->put($name . '/sub', $folderData);
+ $this->cache->put('other/sub', $folderData);
foreach ($childs as $child) {
$this->cache->put($name . '/' . $child, $data);
$this->cache->put('other/' . $child, $data);
diff --git a/tests/lib/files/cache/movefromcachetraittest.php b/tests/lib/files/cache/movefromcachetraittest.php
new file mode 100644
index 00000000000..614c259d996
--- /dev/null
+++ b/tests/lib/files/cache/movefromcachetraittest.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Copyright (c) 2016 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace Test\Files\Cache;
+
+use OC\Files\Cache\MoveFromCacheTrait;
+
+class FallBackCrossCacheMoveCache extends \OC\Files\Cache\Cache {
+ use MoveFromCacheTrait;
+}
+
+/**
+ * Class Cache
+ *
+ * @group DB
+ */
+class MoveFromCacheTraitTest extends Cache {
+ protected function setUp() {
+ parent::setUp();
+
+ $this->storage = new \OC\Files\Storage\Temporary(array());
+ $this->storage2 = new \OC\Files\Storage\Temporary(array());
+ $this->cache = new FallBackCrossCacheMoveCache($this->storage);
+ $this->cache2 = new FallBackCrossCacheMoveCache($this->storage2);
+ }
+}