Make shared folder size propagation test work with object home storage

remotes/origin/dav-zip-folder
Robin Appelman 2015-10-12 17:43:44 +07:00 committed by Thomas Müller
parent e46741cf5d
commit 8efd037eb8
2 changed files with 5 additions and 7 deletions

@ -176,7 +176,7 @@ class MigrationTest extends \Test\TestCase {
)->setMethods(['getSystemMountPoints'])->getMock(); )->setMethods(['getSystemMountPoints'])->getMock();
$m->expects($this->any())->method('getSystemMountPoints') $m->expects($this->any())->method('getSystemMountPoints')
->willReturn([['mountpoint' => 'folder1'], ['mountpoint' => 'folder2']]); ->will($this->returnValue([['mountpoint' => 'folder1'], ['mountpoint' => 'folder2']]));
$m->reorganizeFolderStructure(); $m->reorganizeFolderStructure();
// even if it runs twice folder should always move only once // even if it runs twice folder should always move only once

@ -108,9 +108,8 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
$this->sharedCache->put('', array('mtime' => 10, 'storage_mtime' => 10, 'size' => '-1', 'mimetype' => 'httpd/unix-directory')); $this->sharedCache->put('', array('mtime' => 10, 'storage_mtime' => 10, 'size' => '-1', 'mimetype' => 'httpd/unix-directory'));
// run the propagation code // run the propagation code
$result = $this->sharedStorage->getWatcher()->checkUpdate(''); $this->sharedStorage->getWatcher()->checkUpdate('');
$this->sharedStorage->getCache()->correctFolderSize('');
$this->assertTrue($result);
// the owner's parent dirs must have increase size // the owner's parent dirs must have increase size
$newSizes = self::getOwnerDirSizes('files/container/shareddir'); $newSizes = self::getOwnerDirSizes('files/container/shareddir');
@ -139,9 +138,8 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
$this->sharedCache->put('subdir', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain')); $this->sharedCache->put('subdir', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
// run the propagation code // run the propagation code
$result = $this->sharedStorage->getWatcher()->checkUpdate('subdir'); $this->sharedStorage->getWatcher()->checkUpdate('subdir');
$this->sharedStorage->getCache()->correctFolderSize('subdir');
$this->assertTrue($result);
// the owner's parent dirs must have increase size // the owner's parent dirs must have increase size
$newSizes = self::getOwnerDirSizes('files/container/shareddir/subdir'); $newSizes = self::getOwnerDirSizes('files/container/shareddir/subdir');