aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-12-01 12:34:37 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-12-04 15:23:20 +0100
commitd2fe30d464adac9b3a4dc300aad135d1cf682017 (patch)
tree67b52e86b936078351a92b9d93685f913f994211
parentc8a29ec94287855bcd02aad6e315a9656ba0183d (diff)
downloadnextcloud-server-d2fe30d464adac9b3a4dc300aad135d1cf682017.tar.gz
nextcloud-server-d2fe30d464adac9b3a4dc300aad135d1cf682017.zip
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--apps/dav/lib/Connector/Sabre/ObjectTree.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php
index d05f0857ec9..25db1d5028c 100644
--- a/apps/dav/lib/Connector/Sabre/ObjectTree.php
+++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php
@@ -156,7 +156,7 @@ class ObjectTree extends CachingTree {
try {
$info = $this->fileView->getFileInfo($path);
- if ($info->getStorage()->instanceOfStorage(FailedStorage::class)) {
+ if ($info instanceof \OCP\Files\FileInfo && $info->getStorage()->instanceOfStorage(FailedStorage::class)) {
throw new StorageNotAvailableException();
}
} catch (StorageNotAvailableException $e) {
diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
index a8fbcb39a85..cd575e4ff3c 100644
--- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
@@ -174,6 +174,8 @@ class ObjectTreeTest extends \Test\TestCase {
$fileInfo->expects($this->once())
->method('getName')
->will($this->returnValue($outputFileName));
+ $fileInfo->method('getStorage')
+ ->willReturn($this->createMock(\OC\Files\Storage\Common::class));
$view->expects($this->once())
->method('getFileInfo')