aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-05-27 19:35:41 +0200
committerLouis <louis@chmn.me>2025-06-05 11:57:59 +0200
commit077f65455bfbd38c63acc100472d92cdf28a752f (patch)
tree4b61a69b9bada6a7db6a8beac998505b372ebd22
parent662129ca0a42b7573c6cbe2b213b10ac37530591 (diff)
downloadnextcloud-server-backport/52242/stable29.tar.gz
nextcloud-server-backport/52242/stable29.zip
test: add test that object store folder copy preserves folder sizebackport/52242/stable29
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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 a07104a590d..cd3ac963cc9 100644
--- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
+++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
@@ -275,4 +275,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());
+ }
}