Fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-12-01 12:34:37 +01:00
parent c8a29ec942
commit d2fe30d464
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 3 additions and 1 deletions

View File

@ -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) {

View 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')