summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-03-13 22:10:47 +0100
committerGitHub <noreply@github.com>2023-03-13 22:10:47 +0100
commit71328107da996403e44c12586e1da8f26fa4d0f2 (patch)
tree18ba8807e3f353b1c6dffe39d5d069c026103b64 /tests
parente4504820a4e5af7b62568a07d245dc386d21d6bc (diff)
parent9b1d7794a826cd87d0dce77c9ba7691a71137e48 (diff)
downloadnextcloud-server-71328107da996403e44c12586e1da8f26fa4d0f2.tar.gz
nextcloud-server-71328107da996403e44c12586e1da8f26fa4d0f2.zip
Merge pull request #37029 from nextcloud/fix/chunk-objectids-in-systemtagobjectmapper
Add chunking in SystemTagObjectMapper::getTagIdsForObjects
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/SystemTag/SystemTagObjectMapperTest.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/lib/SystemTag/SystemTagObjectMapperTest.php b/tests/lib/SystemTag/SystemTagObjectMapperTest.php
index c988db69c30..e77709c781f 100644
--- a/tests/lib/SystemTag/SystemTagObjectMapperTest.php
+++ b/tests/lib/SystemTag/SystemTagObjectMapperTest.php
@@ -141,6 +141,17 @@ class SystemTagObjectMapperTest extends TestCase {
$this->assertEquals([], $tagIdMapping);
}
+ public function testGetTagIdsForALotOfObjects() {
+ $ids = range(1, 10500);
+ $tagIdMapping = $this->tagMapper->getTagIdsForObjects(
+ $ids,
+ 'testtype'
+ );
+
+ $this->assertEquals(10500, count($tagIdMapping));
+ $this->assertEquals([$this->tag1->getId(), $this->tag2->getId()], $tagIdMapping[1]);
+ }
+
public function testGetObjectsForTags() {
$objectIds = $this->tagMapper->getObjectIdsForTags(
[$this->tag1->getId(), $this->tag2->getId(), $this->tag3->getId()],
@@ -165,7 +176,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $objectIds);
}
-
+
public function testGetObjectsForTagsLimitWithMultipleTags() {
$this->expectException(\InvalidArgumentException::class);
@@ -189,7 +200,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $objectIds);
}
-
+
public function testGetObjectsForNonExistingTag() {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
@@ -227,7 +238,7 @@ class SystemTagObjectMapperTest extends TestCase {
$this->assertTrue(true, 'No error when reassigning/unassigning');
}
-
+
public function testAssignNonExistingTags() {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
@@ -254,7 +265,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $tagIdMapping, 'None of the tags got assigned');
}
-
+
public function testUnassignNonExistingTags() {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
@@ -385,7 +396,7 @@ class SystemTagObjectMapperTest extends TestCase {
);
}
-
+
public function testHaveTagNonExisting() {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);