aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Node/NodeTest.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-02-20 22:12:00 +0100
committerSimon L <szaimen@e.mail.de>2023-04-17 23:46:52 +0200
commitd9c81f56ad25d6665e87468cf18dc2646334fb3b (patch)
tree42859dc2a51ad4613423df4d3fece13fbd3ee6c2 /tests/lib/Files/Node/NodeTest.php
parent160bd75d0ad59b3692ae2e904be52c9e4e7295f4 (diff)
downloadnextcloud-server-d9c81f56ad25d6665e87468cf18dc2646334fb3b.tar.gz
nextcloud-server-d9c81f56ad25d6665e87468cf18dc2646334fb3b.zip
tests: Adapt node related unit tests mocks to required root view
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests/lib/Files/Node/NodeTest.php')
-rw-r--r--tests/lib/Files/Node/NodeTest.php14
1 files changed, 14 insertions, 0 deletions
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();
@@ -66,6 +69,17 @@ abstract class NodeTest extends \Test\TestCase {
}
/**
+ * @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
* @param string $path