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

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/52242/head
Robin Appelman 4 months ago committed by Louis
parent 5b3f4cd8fe
commit e21ce793a5
  1. 13
      tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php

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

Loading…
Cancel
Save