Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-08-15 13:45:41 +0300
committerRobin Appelman <robin@icewind.nl>2022-08-16 14:47:43 +0300
commit887952b4f4761415b048ed7b453442b0ea234a21 (patch)
tree562e0cdbd28f6097a4485b8795a1754706e1f415
parent10767d77799e2b530ac3220b2cf79719dcf8cce9 (diff)
add tests for cached mount provider migrationmount-provider-migration
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--tests/lib/Files/Config/UserMountCacheTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php
index 8b26b309daa..f1206781c5e 100644
--- a/tests/lib/Files/Config/UserMountCacheTest.php
+++ b/tests/lib/Files/Config/UserMountCacheTest.php
@@ -507,4 +507,29 @@ class UserMountCacheTest extends TestCase {
$result = $this->cache->getUsedSpaceForUsers([$user1, $user2]);
$this->assertEquals(['u1' => 100], $result);
}
+
+
+ public function testMigrateMountProvider() {
+ $user1 = $this->userManager->get('u1');
+
+ [$storage1, $rootId] = $this->getStorage(2);
+ $rootId = $this->createCacheEntry('', 2);
+ $mount1 = new MountPoint($storage1, '/foo/');
+ $this->cache->registerMounts($user1, [$mount1]);
+
+ $this->clearCache();
+
+ $cachedMounts = $this->cache->getMountsForUser($user1);
+ $this->assertCount(1, $cachedMounts);
+ $this->assertEquals('', $cachedMounts[0]->getMountProvider());
+
+ $mount1 = new MountPoint($storage1, '/foo/', null, null, null, null, 'dummy');
+ $this->cache->registerMounts($user1, [$mount1], ['dummy']);
+
+ $this->clearCache();
+
+ $cachedMounts = $this->cache->getMountsForUser($user1);
+ $this->assertCount(1, $cachedMounts);
+ $this->assertEquals('dummy', $cachedMounts[0]->getMountProvider());
+ }
}