Skip to content

Commit 79a0cda

Browse files
committed
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>
1 parent 7eb607c commit 79a0cda

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,17 @@ public function testCopyGrantsPermissions() {
263263
$this->assertTrue($cache->inCache('new.txt'));
264264
$this->assertEquals(\OCP\Constants::PERMISSION_ALL, $instance->getPermissions('new.txt'));
265265
}
266+
267+
public function testCopyFolderSize(): void {
268+
$cache = $this->instance->getCache();
269+
270+
$this->instance->mkdir('source');
271+
$this->instance->file_put_contents('source/test.txt', 'foo');
272+
$this->instance->getUpdater()->update('source/test.txt');
273+
$this->assertEquals(3, $cache->get('source')->getSize());
274+
275+
$this->assertTrue($this->instance->copy('source', 'target'));
276+
277+
$this->assertEquals(3, $cache->get('target')->getSize());
278+
}
266279
}

0 commit comments

Comments
 (0)