Skip to content

Commit dd07abc

Browse files
committed
add tests for cached mount provider migration
1 parent 860f80d commit dd07abc

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/lib/Files/Config/UserMountCacheTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,4 +507,29 @@ public function testGetUsedSpaceForUsers() {
507507
$result = $this->cache->getUsedSpaceForUsers([$user1, $user2]);
508508
$this->assertEquals(['u1' => 100], $result);
509509
}
510+
511+
512+
public function testMigrateMountProvider() {
513+
$user1 = $this->userManager->get('u1');
514+
515+
[$storage1, $rootId] = $this->getStorage(2);
516+
$rootId = $this->createCacheEntry('', 2);
517+
$mount1 = new MountPoint($storage1, '/foo/');
518+
$this->cache->registerMounts($user1, [$mount1]);
519+
520+
$this->clearCache();
521+
522+
$cachedMounts = $this->cache->getMountsForUser($user1);
523+
$this->assertCount(1, $cachedMounts);
524+
$this->assertEquals('', $cachedMounts[0]->getMountProvider());
525+
526+
$mount1 = new MountPoint($storage1, '/foo/', null, null, null, null, 'dummy');
527+
$this->cache->registerMounts($user1, [$mount1], ['dummy']);
528+
529+
$this->clearCache();
530+
531+
$cachedMounts = $this->cache->getMountsForUser($user1);
532+
$this->assertCount(1, $cachedMounts);
533+
$this->assertEquals('dummy', $cachedMounts[0]->getMountProvider());
534+
}
510535
}

0 commit comments

Comments
 (0)