aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2025-06-02 12:00:39 +0200
committerLouis Chemineau <louis@chmn.me>2025-06-02 12:00:59 +0200
commit79a0cdade44701c3d1fbc8e33c07b3e88e00aadd (patch)
treeaf742fc24974cd4c6c1d3f7237ac12c3c33d9757
parent7eb607c8b9da0445f3b07c304882fba5675020f7 (diff)
downloadnextcloud-server-backport/52242/stable30.tar.gz
nextcloud-server-backport/52242/stable30.zip
test: add test that object store folder copy preserves folder sizebackport/52242/stable30
Signed-off-by: Robin Appelman <robin@icewind.nl> Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r--tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
index 6b64fa8ca62..bc989a4921a 100644
--- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
+++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
@@ -263,4 +263,17 @@ class ObjectStoreStorageTest extends Storage {
$this->assertTrue($cache->inCache('new.txt'));
$this->assertEquals(\OCP\Constants::PERMISSION_ALL, $instance->getPermissions('new.txt'));
}
+
+ public function testCopyFolderSize(): void {
+ $cache = $this->instance->getCache();
+
+ $this->instance->mkdir('source');
+ $this->instance->file_put_contents('source/test.txt', 'foo');
+ $this->instance->getUpdater()->update('source/test.txt');
+ $this->assertEquals(3, $cache->get('source')->getSize());
+
+ $this->assertTrue($this->instance->copy('source', 'target'));
+
+ $this->assertEquals(3, $cache->get('target')->getSize());
+ }
}