summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-01-08 11:54:07 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2021-01-11 13:43:34 +0100
commit45e3261ad5961e78ab919f14ff9234da0ba740b5 (patch)
treeea33f4a3b761acb4edfcf0165d17966ba0126d41 /apps/user_ldap/tests/Mapping/AbstractMappingTest.php
parent8b656e321bbf358d8074ce8a3976fac5defdece0 (diff)
downloadnextcloud-server-45e3261ad5961e78ab919f14ff9234da0ba740b5.tar.gz
nextcloud-server-45e3261ad5961e78ab919f14ff9234da0ba740b5.zip
respect DB limits limit per statement and query
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests/Mapping/AbstractMappingTest.php')
-rw-r--r--apps/user_ldap/tests/Mapping/AbstractMappingTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
index 079c2e21b10..35259345f25 100644
--- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
+++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
@@ -281,4 +281,23 @@ abstract class AbstractMappingTest extends \Test\TestCase {
$results = $mapper->getList(1, 1);
$this->assertSame(1, count($results));
}
+
+ public function testGetListOfIdsByDn() {
+ /** @var AbstractMapping $mapper */
+ list($mapper,) = $this->initTest();
+
+ $listOfDNs = [];
+ for ($i = 0; $i < 66640; $i++) {
+ // Postgres has a limit of 65535 values in a single IN list
+ $name = 'as_' . $i;
+ $dn = 'uid=' . $name . ',dc=example,dc=org';
+ $listOfDNs[] = $dn;
+ if ($i % 20 === 0) {
+ $mapper->map($dn, $name, 'fake-uuid-' . $i);
+ }
+ }
+
+ $result = $mapper->getListOfIdsByDn($listOfDNs);
+ $this->assertSame(66640 / 20, count($result));
+ }
}