From d9c81f56ad25d6665e87468cf18dc2646334fb3b Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 20 Feb 2023 22:12:00 +0100 Subject: tests: Adapt node related unit tests mocks to required root view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/lib/Files/Node/NodeTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/lib/Files/Node/NodeTest.php') diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php index 8c0d4cdb293..b63d287a191 100644 --- a/tests/lib/Files/Node/NodeTest.php +++ b/tests/lib/Files/Node/NodeTest.php @@ -54,6 +54,9 @@ abstract class NodeTest extends \Test\TestCase { $this->view = $this->getMockBuilder(View::class) ->disableOriginalConstructor() ->getMock(); + $this->view->expects($this->any()) + ->method('getRoot') + ->willReturn(''); $this->userMountCache = $this->getMockBuilder('\OCP\Files\Config\IUserMountCache') ->disableOriginalConstructor() ->getMock(); @@ -65,6 +68,17 @@ abstract class NodeTest extends \Test\TestCase { ->getMock(); } + /** + * @return \OC\Files\View | \PHPUnit\Framework\MockObject\MockObject $view + */ + protected function getRootViewMock() { + $view = $this->createMock(View::class); + $view->expects($this->any()) + ->method('getRoot') + ->willReturn(''); + return $view; + } + /** * @param IRootFolder $root * @param View $view -- cgit v1.2.3