summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/systemtag/systemtagobjectmappertest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/lib/systemtag/systemtagobjectmappertest.php b/tests/lib/systemtag/systemtagobjectmappertest.php
index 5c8204f6a87..f81445e5348 100644
--- a/tests/lib/systemtag/systemtagobjectmappertest.php
+++ b/tests/lib/systemtag/systemtagobjectmappertest.php
@@ -145,6 +145,42 @@ class SystemTagObjectMapperTest extends TestCase {
], $objectIds);
}
+ public function testGetObjectsForTagsLimit() {
+ $objectIds = $this->tagMapper->getObjectIdsForTags(
+ [$this->tag1->getId()],
+ 'testtype',
+ 1
+ );
+
+ $this->assertEquals([
+ 1,
+ ], $objectIds);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testGetObjectsForTagsLimitWithMultipleTags() {
+ $this->tagMapper->getObjectIdsForTags(
+ [$this->tag1->getId(), $this->tag2->getId(), $this->tag3->getId()],
+ 'testtype',
+ 1
+ );
+ }
+
+ public function testGetObjectsForTagsLimitOffset() {
+ $objectIds = $this->tagMapper->getObjectIdsForTags(
+ [$this->tag1->getId()],
+ 'testtype',
+ 1,
+ '1'
+ );
+
+ $this->assertEquals([
+ 2,
+ ], $objectIds);
+ }
+
/**
* @expectedException \OCP\SystemTag\TagNotFoundException
*/