]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix tests 22421/head
authorRobin Appelman <robin@icewind.nl>
Wed, 26 Aug 2020 13:46:24 +0000 (15:46 +0200)
committerRobin Appelman <robin@icewind.nl>
Wed, 26 Aug 2020 13:46:24 +0000 (15:46 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php

index b05c7cdca2aac301820c3c2aff1c2a46bb88d2cb..6e0cac8e9cc11802b752eb4c1e161b1cea6b9584 100644 (file)
@@ -33,6 +33,7 @@ use OC\Files\FileInfo;
 use OC\Files\Storage\Wrapper\Quota;
 use OCA\DAV\Connector\Sabre\Directory;
 use OCP\Files\ForbiddenException;
+use OCP\Files\Mount\IMountPoint;
 
 class TestViewDirectory extends \OC\Files\View {
        private $updatables;
@@ -270,9 +271,12 @@ class DirectoryTest extends \Test\TestCase {
        }
 
        public function testGetQuotaInfoUnlimited() {
+               $mountPoint = $this->createMock(IMountPoint::class);
                $storage = $this->getMockBuilder(Quota::class)
                        ->disableOriginalConstructor()
                        ->getMock();
+               $mountPoint->method('getStorage')
+                       ->willReturn($storage);
 
                $storage->expects($this->any())
                        ->method('instanceOfStorage')
@@ -293,8 +297,8 @@ class DirectoryTest extends \Test\TestCase {
                        ->willReturn(200);
 
                $this->info->expects($this->once())
-                       ->method('getStorage')
-                       ->willReturn($storage);
+                       ->method('getMountPoint')
+                       ->willReturn($mountPoint);
 
                $this->view->expects($this->once())
                        ->method('getFileInfo')
@@ -305,9 +309,12 @@ class DirectoryTest extends \Test\TestCase {
        }
 
        public function testGetQuotaInfoSpecific() {
+               $mountPoint = $this->createMock(IMountPoint::class);
                $storage = $this->getMockBuilder(Quota::class)
                        ->disableOriginalConstructor()
                        ->getMock();
+               $mountPoint->method('getStorage')
+                       ->willReturn($storage);
 
                $storage->expects($this->any())
                        ->method('instanceOfStorage')
@@ -329,8 +336,8 @@ class DirectoryTest extends \Test\TestCase {
                        ->willReturn(200);
 
                $this->info->expects($this->once())
-                       ->method('getStorage')
-                       ->willReturn($storage);
+                       ->method('getMountPoint')
+                       ->willReturn($mountPoint);
 
                $this->view->expects($this->once())
                        ->method('getFileInfo')