summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/User_LDAPTest.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-06-24 23:34:37 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-06-24 23:34:37 +0200
commitb8bef4ded07f1b7197437f9914ace4d2763e1b9f (patch)
tree161789f9af3affb5ace9e366f80c8c5deb59c2fe /apps/user_ldap/tests/User_LDAPTest.php
parent7d4682da4008300c01f5745b438811032317e4c1 (diff)
downloadnextcloud-server-b8bef4ded07f1b7197437f9914ace4d2763e1b9f.tar.gz
nextcloud-server-b8bef4ded07f1b7197437f9914ace4d2763e1b9f.zip
fix strings being passed where arrays where expected
also brought type hints up to internal API level Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests/User_LDAPTest.php')
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 00ca6737175..bfdaa99ac00 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -183,6 +183,10 @@ class User_LDAPTest extends TestCase {
}
return false;
});
+
+ $this->userManager->expects($this->any())
+ ->method('getAttributes')
+ ->willReturn(['dn', 'uid', 'mail', 'displayname']);
}
public function testCheckPasswordUidReturn() {
@@ -400,6 +404,10 @@ class User_LDAPTest extends TestCase {
->willReturnArgument(0);
$this->access->method('fetchUsersByLoginName')
->willReturn([]);
+
+ $this->access->userManager->expects($this->any())
+ ->method('getAttributes')
+ ->willReturn(['dn', 'uid', 'mail', 'displayname']);
}
public function testGetUsersNoParam() {
@@ -1065,6 +1073,9 @@ class User_LDAPTest extends TestCase {
->method('get')
->with($dn)
->willReturn($user);
+ $this->userManager->expects($this->any())
+ ->method('getAttributes')
+ ->willReturn(['dn', 'uid', 'mail', 'displayname']);
$name = $backend->loginName2UserName($loginName);
$this->assertSame($username, $name);
@@ -1093,6 +1104,10 @@ class User_LDAPTest extends TestCase {
->method('writeToCache')
->with($this->equalTo('loginName2UserName-'.$loginName), false);
+ $this->userManager->expects($this->any())
+ ->method('getAttributes')
+ ->willReturn(['dn', 'uid', 'mail', 'displayname']);
+
$backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager);
$name = $backend->loginName2UserName($loginName);
$this->assertSame(false, $name);
@@ -1126,6 +1141,9 @@ class User_LDAPTest extends TestCase {
->method('get')
->with($dn)
->willReturn($offlineUser);
+ $this->userManager->expects($this->any())
+ ->method('getAttributes')
+ ->willReturn(['dn', 'uid', 'mail', 'displayname']);
$backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager);
$name = $backend->loginName2UserName($loginName);