Skip to content

Commit 97039a4

Browse files
icewind1991AndyScherzinger
authored andcommitted
test: add test that object store folder copy preserves folder size
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent dc87b1b commit 97039a4

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
@@ -275,4 +275,17 @@ public function testCopyGrantsPermissions() {
275275
$this->assertTrue($cache->inCache('new.txt'));
276276
$this->assertEquals(\OCP\Constants::PERMISSION_ALL, $instance->getPermissions('new.txt'));
277277
}
278+
279+
public function testCopyFolderSize(): void {
280+
$cache = $this->instance->getCache();
281+
282+
$this->instance->mkdir('source');
283+
$this->instance->file_put_contents('source/test.txt', 'foo');
284+
$this->instance->getUpdater()->update('source/test.txt');
285+
$this->assertEquals(3, $cache->get('source')->getSize());
286+
287+
$this->assertTrue($this->instance->copy('source', 'target'));
288+
289+
$this->assertEquals(3, $cache->get('target')->getSize());
290+
}
278291
}

0 commit comments

Comments
 (0)