diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-10-12 17:21:54 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-16 21:41:51 +0200 |
commit | 0cdd46de60a7784d610aae61b9e6d52df611f91f (patch) | |
tree | 950c131b3cd2748e67be7d451bb510eb9f6139f2 | |
parent | ef179331bbcb5acce487882d579753573d5bf84a (diff) | |
download | nextcloud-server-0cdd46de60a7784d610aae61b9e6d52df611f91f.tar.gz nextcloud-server-0cdd46de60a7784d610aae61b9e6d52df611f91f.zip |
fix sabre connector tests when using a non local home storage
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/file.php | 15 | ||||
-rw-r--r-- | apps/files_sharing/tests/sharedstorage.php | 7 |
2 files changed, 14 insertions, 8 deletions
diff --git a/apps/dav/tests/unit/connector/sabre/file.php b/apps/dav/tests/unit/connector/sabre/file.php index 9ca8c994a04..9171fc3b786 100644 --- a/apps/dav/tests/unit/connector/sabre/file.php +++ b/apps/dav/tests/unit/connector/sabre/file.php @@ -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; } diff --git a/apps/files_sharing/tests/sharedstorage.php b/apps/files_sharing/tests/sharedstorage.php index de510cf1eec..de36d6dbd42 100644 --- a/apps/files_sharing/tests/sharedstorage.php +++ b/apps/files_sharing/tests/sharedstorage.php @@ -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); |