summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-29 17:03:16 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-29 17:03:16 +0100
commit67bf225fbe4603d84e8461e07881b014cc04eda2 (patch)
tree0aaa035f0e12b47c8304119287fb6112dd9e7671 /tests
parent7d27af5b18e5e9290c7f36861e2631988056122c (diff)
parentec3f6549f6223a9fb752c5a930549c5c1fe7bcc6 (diff)
downloadnextcloud-server-67bf225fbe4603d84e8461e07881b014cc04eda2.tar.gz
nextcloud-server-67bf225fbe4603d84e8461e07881b014cc04eda2.zip
Merge pull request #21956 from owncloud/cross-cache-move
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);
+ }
+}