Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
7e6dd02441
commit
aedc59c636
|
@ -160,7 +160,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
||||||
try {
|
try {
|
||||||
$info = $this->fileView->getFileInfo($path);
|
$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();
|
throw new StorageNotAvailableException();
|
||||||
}
|
}
|
||||||
} catch (StorageNotAvailableException $e) {
|
} catch (StorageNotAvailableException $e) {
|
||||||
|
|
|
@ -174,6 +174,8 @@ class ObjectTreeTest extends \Test\TestCase {
|
||||||
$fileInfo->expects($this->once())
|
$fileInfo->expects($this->once())
|
||||||
->method('getName')
|
->method('getName')
|
||||||
->will($this->returnValue($outputFileName));
|
->will($this->returnValue($outputFileName));
|
||||||
|
$fileInfo->method('getStorage')
|
||||||
|
->willReturn($this->createMock(\OC\Files\Storage\Common::class));
|
||||||
|
|
||||||
$view->expects($this->once())
|
$view->expects($this->once())
|
||||||
->method('getFileInfo')
|
->method('getFileInfo')
|
||||||
|
|
Loading…
Reference in New Issue