Sfoglia il codice sorgente

fix sabre connector tests when using a non local home storage

tags/v9.0beta1
Robin Appelman 8 anni fa
parent
commit
0cdd46de60

+ 9
- 6
apps/dav/tests/unit/connector/sabre/file.php Vedi File

@@ -8,6 +8,7 @@

namespace Test\Connector\Sabre;

use OC\Files\Storage\Local;
use Test\HookHelper;
use OC\Files\Filesystem;
use OCP\Lock\ILockingProvider;
@@ -798,14 +799,16 @@ class File extends \Test\TestCase {
}
$files = [];
list($storage, $internalPath) = $userView->resolvePath($path);
$realPath = $storage->getSourcePath($internalPath);
$dh = opendir($realPath);
while (($file = readdir($dh)) !== false) {
if (substr($file, strlen($file) - 5, 5) === '.part') {
$files[] = $file;
if($storage instanceof Local) {
$realPath = $storage->getSourcePath($internalPath);
$dh = opendir($realPath);
while (($file = readdir($dh)) !== false) {
if (substr($file, strlen($file) - 5, 5) === '.part') {
$files[] = $file;
}
}
closedir($dh);
}
closedir($dh);
return $files;
}


+ 5
- 2
apps/files_sharing/tests/sharedstorage.php Vedi File

@@ -47,8 +47,10 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
}

protected function tearDown() {
$this->view->unlink($this->folder);
$this->view->unlink($this->filename);
if ($this->view) {
$this->view->unlink($this->folder);
$this->view->unlink($this->filename);
}

\OC\Files\Filesystem::getLoader()->removeStorageWrapper('oc_trashbin');

@@ -85,6 +87,7 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
$this->assertFalse($user2View->is_dir($this->folder));

// delete the local folder
// list($storage, $internalPa)
$fullPath = \OC_Config::getValue('datadirectory') . '/' . self::TEST_FILES_SHARING_API_USER2 . '/files/localfolder';
rmdir($fullPath);


Loading…
Annulla
Salva