test: add test that object store folder copy preserves folder size

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/53253/head
Robin Appelman 2025-05-27 19:35:41 +07:00 committed by backportbot[bot]
parent edfb7b2393
commit 5f45b4f5fc
1 changed files with 13 additions and 0 deletions

@ -262,4 +262,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());
}
}