aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-02-07 14:49:31 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-06 10:54:00 +0100
commit51019fda7a74816ca38962d899e7b641a4d5f88e (patch)
treea260970e974db122859334001a517cadb94fc15b /tests
parente33b32095ea32177219eb863fe91f62b601f4324 (diff)
downloadnextcloud-server-51019fda7a74816ca38962d899e7b641a4d5f88e.tar.gz
nextcloud-server-51019fda7a74816ca38962d899e7b641a4d5f88e.zip
fix: clearify logic around getMountsForFileId filtering
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/Config/UserMountCacheTest.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php
index 10984e1d578..9e910f4f47f 100644
--- a/tests/lib/Files/Config/UserMountCacheTest.php
+++ b/tests/lib/Files/Config/UserMountCacheTest.php
@@ -137,7 +137,7 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(1, $cachedMounts);
$cachedMount = $cachedMounts[$this->keyForMount($mount)];
$this->assertEquals('/asd/', $cachedMount->getMountPoint());
- $this->assertEquals($user, $cachedMount->getUser());
+ $this->assertEquals($user->getUID(), $cachedMount->getUser()->getUID());
$this->assertEquals($storage->getCache()->getId(''), $cachedMount->getRootId());
$this->assertEquals($storage->getStorageCache()->getNumericId(), $cachedMount->getStorageId());
}
@@ -161,7 +161,7 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(1, $cachedMounts);
$cachedMount = $cachedMounts[$this->keyForMount($mount)];
$this->assertEquals('/asd/', $cachedMount->getMountPoint());
- $this->assertEquals($user, $cachedMount->getUser());
+ $this->assertEquals($user->getUID(), $cachedMount->getUser()->getUID());
$this->assertEquals($storage->getCache()->getId(''), $cachedMount->getRootId());
$this->assertEquals($storage->getStorageCache()->getNumericId(), $cachedMount->getStorageId());
}
@@ -253,13 +253,13 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(2, $cachedMounts);
$this->assertEquals('/foo/', $cachedMounts[$this->keyForMount($mount1)]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[$this->keyForMount($mount1)]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[$this->keyForMount($mount1)]->getUser()->getUID());
$this->assertEquals($id1, $cachedMounts[$this->keyForMount($mount1)]->getRootId());
$this->assertEquals(1, $cachedMounts[$this->keyForMount($mount1)]->getStorageId());
$this->assertEquals('', $cachedMounts[$this->keyForMount($mount1)]->getRootInternalPath());
$this->assertEquals('/bar/', $cachedMounts[$this->keyForMount($mount2)]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[$this->keyForMount($mount2)]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[$this->keyForMount($mount2)]->getUser()->getUID());
$this->assertEquals($id2, $cachedMounts[$this->keyForMount($mount2)]->getRootId());
$this->assertEquals(2, $cachedMounts[$this->keyForMount($mount2)]->getStorageId());
$this->assertEquals('foo/bar', $cachedMounts[$this->keyForMount($mount2)]->getRootInternalPath());
@@ -288,12 +288,12 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(2, $cachedMounts);
$this->assertEquals('/bar/', $cachedMounts[0]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[0]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[0]->getUser()->getUID());
$this->assertEquals($id2, $cachedMounts[0]->getRootId());
$this->assertEquals(2, $cachedMounts[0]->getStorageId());
$this->assertEquals('/bar/', $cachedMounts[1]->getMountPoint());
- $this->assertEquals($user2, $cachedMounts[1]->getUser());
+ $this->assertEquals($user2->getUID(), $cachedMounts[1]->getUser()->getUID());
$this->assertEquals($id2, $cachedMounts[1]->getRootId());
$this->assertEquals(2, $cachedMounts[1]->getStorageId());
}
@@ -318,12 +318,12 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(2, $cachedMounts);
$this->assertEquals('/bar/', $cachedMounts[0]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[0]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[0]->getUser()->getUID());
$this->assertEquals($id2, $cachedMounts[0]->getRootId());
$this->assertEquals(2, $cachedMounts[0]->getStorageId());
$this->assertEquals('/bar/', $cachedMounts[1]->getMountPoint());
- $this->assertEquals($user2, $cachedMounts[1]->getUser());
+ $this->assertEquals($user2->getUID(), $cachedMounts[1]->getUser()->getUID());
$this->assertEquals($id2, $cachedMounts[1]->getRootId());
$this->assertEquals(2, $cachedMounts[1]->getStorageId());
}
@@ -378,7 +378,7 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(1, $cachedMounts);
$this->assertEquals('/foo/', $cachedMounts[0]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[0]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[0]->getUser()->getUID());
$this->assertEquals($rootId, $cachedMounts[0]->getRootId());
$this->assertEquals(2, $cachedMounts[0]->getStorageId());
}
@@ -400,7 +400,7 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(1, $cachedMounts);
$this->assertEquals('/foo/', $cachedMounts[0]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[0]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[0]->getUser()->getUID());
$this->assertEquals($rootId, $cachedMounts[0]->getRootId());
$this->assertEquals(2, $cachedMounts[0]->getStorageId());
$this->assertEquals('foo/bar', $cachedMounts[0]->getInternalPath());
@@ -433,7 +433,7 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(1, $cachedMounts);
$this->assertEquals('/', $cachedMounts[0]->getMountPoint());
- $this->assertEquals($user1, $cachedMounts[0]->getUser());
+ $this->assertEquals($user1->getUID(), $cachedMounts[0]->getUser()->getUID());
$this->assertEquals($folderId, $cachedMounts[0]->getRootId());
$this->assertEquals(2, $cachedMounts[0]->getStorageId());
$this->assertEquals('foo', $cachedMounts[0]->getRootInternalPath());