summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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');