aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-07-13 16:29:51 +0200
committerRobin Appelman <icewind@owncloud.com>2016-07-13 16:34:08 +0200
commit29eeeb2273782b72219c603e084a1d459514c361 (patch)
tree29ca6e4c3ab0b987ceebb0106df04b30feeee48b /tests
parentafef11f84aef91178d5bb566d6e726f969fd69d9 (diff)
downloadnextcloud-server-29eeeb2273782b72219c603e084a1d459514c361.tar.gz
nextcloud-server-29eeeb2273782b72219c603e084a1d459514c361.zip
Save the files external mount id in the mount cache table
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/Config/UserMountCacheTest.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php
index e7554fc36d9..b9e09687c95 100644
--- a/tests/lib/Files/Config/UserMountCacheTest.php
+++ b/tests/lib/Files/Config/UserMountCacheTest.php
@@ -163,12 +163,14 @@ class UserMountCacheTest extends TestCase {
$user = $this->userManager->get('u1');
$storage = $this->getStorage(10, 20);
- $mount = new MountPoint($storage, '/foo/');
+ $mount = new MountPoint($storage, '/bar/');
$this->cache->registerMounts($user, [$mount]);
$this->clearCache();
+ $mount = new MountPoint($storage, '/foo/');
+
$this->cache->registerMounts($user, [$mount]);
$this->clearCache();
@@ -180,6 +182,29 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals('/foo/', $cachedMount->getMountPoint());
}
+ public function testChangeMountId() {
+ $user = $this->userManager->get('u1');
+
+ $storage = $this->getStorage(10, 20);
+ $mount = new MountPoint($storage, '/foo/', null, null, null, null);
+
+ $this->cache->registerMounts($user, [$mount]);
+
+ $this->clearCache();
+
+ $mount = new MountPoint($storage, '/foo/', null, null, null, 1);
+
+ $this->cache->registerMounts($user, [$mount]);
+
+ $this->clearCache();
+
+ $cachedMounts = $this->cache->getMountsForUser($user);
+
+ $this->assertCount(1, $cachedMounts);
+ $cachedMount = $cachedMounts[0];
+ $this->assertEquals(1, $cachedMount->getMountId());
+ }
+
public function testGetMountsForUser() {
$user1 = $this->userManager->get('u1');
$user2 = $this->userManager->get('u2');