]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix tests 7407/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Fri, 1 Dec 2017 11:34:37 +0000 (12:34 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 6 Dec 2017 08:15:49 +0000 (09:15 +0100)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Connector/Sabre/ObjectTree.php
apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php

index f37ffc19e290a665ed650a9d3c69a51579e76342..bd2da1d25b29fc92bfcdaceafedfa7b5f30e35bb 100644 (file)
@@ -160,7 +160,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
                        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) {
index 53f60bd0f1c2d053f6dabc72fba93bf4e837c704..efb6d88ae575bdf0a8cc22994b69e4da1b9bf424 100644 (file)
@@ -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')