diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-10-27 13:36:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 13:36:33 +0200 |
commit | 1524b5fd2542d175b347bea0244728c4169b2fb8 (patch) | |
tree | cd9ad297db3bcb0b660494c0adcade3ea59f6256 /tests/lib/Files/Config | |
parent | aad2525cf512adbd8fc1c95c12e2823e4cae606e (diff) | |
parent | 82b915e7bbc6faf796b344c5afc84146a574f06e (diff) | |
download | nextcloud-server-1524b5fd2542d175b347bea0244728c4169b2fb8.tar.gz nextcloud-server-1524b5fd2542d175b347bea0244728c4169b2fb8.zip |
Merge pull request #34797 from nextcloud/backport/33540/stable24
[stable24] fix updating cached mounts that didn't have their mount provider set previously
Diffstat (limited to 'tests/lib/Files/Config')
-rw-r--r-- | tests/lib/Files/Config/UserMountCacheTest.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index f4c6a427abd..c4f9688f3b2 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -506,4 +506,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()); + } } |