Skip to content

Commit e21ce79

Browse files
icewind1991artonge
authored andcommitted
test: add test that object store folder copy preserves folder size
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 5b3f4cd commit e21ce79

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
@@ -262,4 +262,17 @@ public function testCopyGrantsPermissions(): void {
262262
$this->assertTrue($cache->inCache('new.txt'));
263263
$this->assertEquals(\OCP\Constants::PERMISSION_ALL, $instance->getPermissions('new.txt'));
264264
}
265+
266+
public function testCopyFolderSize(): void {
267+
$cache = $this->instance->getCache();
268+
269+
$this->instance->mkdir('source');
270+
$this->instance->file_put_contents('source/test.txt', 'foo');
271+
$this->instance->getUpdater()->update('source/test.txt');
272+
$this->assertEquals(3, $cache->get('source')->getSize());
273+
274+
$this->assertTrue($this->instance->copy('source', 'target'));
275+
276+
$this->assertEquals(3, $cache->get('target')->getSize());
277+
}
265278
}

0 commit comments

Comments
 (0)