summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-02-14 14:02:03 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-02-14 14:13:32 +0100
commit5c10a464453adb7c23fe29a98c71dde198007642 (patch)
tree6cba6a041b6d834afdd1782e92213c12b6d57053 /apps/user_ldap/tests
parente65f7f05de6443bd66b1c31325cbc3cbe149d1e5 (diff)
downloadnextcloud-server-5c10a464453adb7c23fe29a98c71dde198007642.tar.gz
nextcloud-server-5c10a464453adb7c23fe29a98c71dde198007642.zip
ensure attribute names are lower cased
otherwise they will be skipped when the results is being formatted and the lower-cased result keys do not match. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/User/ManagerTest.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php
index 5c111abdc4e..1fb548f59bf 100644
--- a/apps/user_ldap/tests/User/ManagerTest.php
+++ b/apps/user_ldap/tests/User/ManagerTest.php
@@ -233,18 +233,22 @@ class ManagerTest extends \Test\TestCase {
*/
public function testGetAttributes($minimal) {
$this->connection->setConfiguration([
- 'ldapEmailAttribute' => 'mail',
+ 'ldapEmailAttribute' => 'MAIL',
'ldapUserAvatarRule' => 'default',
'ldapQuotaAttribute' => '',
+ 'ldapUserDisplayName2' => 'Mail',
]);
$attributes = $this->manager->getAttributes($minimal);
$this->assertTrue(in_array('dn', $attributes));
- $this->assertTrue(in_array($this->access->getConnection()->ldapEmailAttribute, $attributes));
+ $this->assertTrue(in_array(strtolower($this->access->getConnection()->ldapEmailAttribute), $attributes));
+ $this->assertTrue(!in_array($this->access->getConnection()->ldapEmailAttribute, $attributes)); #cases check
$this->assertFalse(in_array('', $attributes));
$this->assertSame(!$minimal, in_array('jpegphoto', $attributes));
$this->assertSame(!$minimal, in_array('thumbnailphoto', $attributes));
+ $valueCounts = array_count_values($attributes);
+ $this->assertSame(1, $valueCounts['mail']);
}
}