summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-05-24 15:23:50 +0200
committerJoas Schilling <coding@schilljs.com>2016-07-18 10:26:36 +0200
commit8e13ff2c8621efc2640ff1fcd2c2b58391b09f6c (patch)
tree770f5a144c33b6267d404a7149a18b92b3ee09fa /apps/dav/tests
parent5157c5a9c4b08518dc86e5755b991183f4323c43 (diff)
downloadnextcloud-server-8e13ff2c8621efc2640ff1fcd2c2b58391b09f6c.tar.gz
nextcloud-server-8e13ff2c8621efc2640ff1fcd2c2b58391b09f6c.zip
Fix TODO and bring in abstraction (similar to comments)
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php
index 628abe6689a..5b864802251 100644
--- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php
+++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php
@@ -71,13 +71,12 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase {
$this->userFolder = $this->getMockBuilder('\OCP\Files\Folder')
->getMock();
+ $userFolder = $this->userFolder;
- $fileRoot = $this->getMockBuilder('\OCP\Files\IRootFolder')
- ->getMock();
- $fileRoot->expects($this->any())
- ->method('getUserfolder')
- ->with('testuser')
- ->will($this->returnValue($this->userFolder));
+ $closure = function($name) use ($userFolder) {
+ $nodes = $userFolder->getById(intval($name));
+ return !empty($nodes);
+ };
$this->node = new \OCA\DAV\SystemTag\SystemTagsObjectTypeCollection(
'files',
@@ -85,7 +84,7 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase {
$this->tagMapper,
$userSession,
$groupManager,
- $fileRoot
+ $closure
);
}