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

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
Louis Chemineau 2025-06-02 12:00:39 +02:00
parent 7eb607c8b9
commit 79a0cdade4
No known key found for this signature in database

View file

@ -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());
}
}