summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-25 20:37:28 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-25 20:37:28 +0200
commitadcafbde34b8f4c75dbf724e929766a1f7d964d4 (patch)
tree993d117c7f7e9773eca8e445c63475c9ef207081 /tests
parent4eddef1556ac7ee7fc0c7e82279672c52d9b6db9 (diff)
parentdbb6a10364fb87989cb13f704887782a1531e16b (diff)
downloadnextcloud-server-adcafbde34b8f4c75dbf724e929766a1f7d964d4.tar.gz
nextcloud-server-adcafbde34b8f4c75dbf724e929766a1f7d964d4.zip
Merge branch 'master' into fix_for_2377
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/cache.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 7b0453edb0d..f272655925b 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -21,11 +21,19 @@ class Cache extends \PHPUnit_Framework_TestCase {
* @var \OC\Files\Storage\Temporary $storage;
*/
private $storage;
+ /**
+ * @var \OC\Files\Storage\Temporary $storage2;
+ */
+ private $storage2;
/**
* @var \OC\Files\Cache\Cache $cache
*/
private $cache;
+ /**
+ * @var \OC\Files\Cache\Cache $cache2
+ */
+ private $cache2;
public function testSimple() {
$file1 = 'foo';
@@ -172,6 +180,13 @@ class Cache extends \PHPUnit_Framework_TestCase {
$this->cache->put($file4, $data);
$this->cache->put($file5, $data);
+ /* simulate a second user with a different storage id but the same folder structure */
+ $this->cache2->put($file1, $folderData);
+ $this->cache2->put($file2, $folderData);
+ $this->cache2->put($file3, $folderData);
+ $this->cache2->put($file4, $data);
+ $this->cache2->put($file5, $data);
+
$this->cache->move('folder/foo', 'folder/foobar');
$this->assertFalse($this->cache->inCache('folder/foo'));
@@ -182,6 +197,16 @@ class Cache extends \PHPUnit_Framework_TestCase {
$this->assertTrue($this->cache->inCache('folder/foobar'));
$this->assertTrue($this->cache->inCache('folder/foobar/1'));
$this->assertTrue($this->cache->inCache('folder/foobar/2'));
+
+ /* the folder structure of the second user must not change! */
+ $this->assertTrue($this->cache2->inCache('folder/bar'));
+ $this->assertTrue($this->cache2->inCache('folder/foo'));
+ $this->assertTrue($this->cache2->inCache('folder/foo/1'));
+ $this->assertTrue($this->cache2->inCache('folder/foo/2'));
+
+ $this->assertFalse($this->cache2->inCache('folder/foobar'));
+ $this->assertFalse($this->cache2->inCache('folder/foobar/1'));
+ $this->assertFalse($this->cache2->inCache('folder/foobar/2'));
}
function testGetIncomplete() {
@@ -328,6 +353,8 @@ class Cache extends \PHPUnit_Framework_TestCase {
public function setUp() {
$this->storage = new \OC\Files\Storage\Temporary(array());
+ $this->storage2 = new \OC\Files\Storage\Temporary(array());
$this->cache = new \OC\Files\Cache\Cache($this->storage);
+ $this->cache2 = new \OC\Files\Cache\Cache($this->storage2);
}
}