summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/user/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/tests/user/user.php')
-rw-r--r--apps/user_ldap/tests/user/user.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/apps/user_ldap/tests/user/user.php b/apps/user_ldap/tests/user/user.php
index 6fa7f3b6b27..046edf58968 100644
--- a/apps/user_ldap/tests/user/user.php
+++ b/apps/user_ldap/tests/user/user.php
@@ -749,7 +749,7 @@ class Test_User_User extends \Test\TestCase {
'markRefreshTime',
'updateQuota',
'updateEmail',
- 'storeDisplayName',
+ 'composeAndStoreDisplayName',
'storeLDAPUserName',
'getHomePath',
'updateAvatar'
@@ -894,4 +894,29 @@ class Test_User_User extends \Test\TestCase {
$user->getHomePath();
}
+
+ public function displayNameProvider() {
+ return [
+ ['Roland Deschain', '', 'Roland Deschain'],
+ ['Roland Deschain', null, 'Roland Deschain'],
+ ['Roland Deschain', 'gunslinger@darktower.com', 'Roland Deschain (gunslinger@darktower.com)'],
+ ];
+ }
+
+ /**
+ * @dataProvider displayNameProvider
+ */
+ public function testComposeAndStoreDisplayName($part1, $part2, $expected) {
+ list($access, $config, $filesys, $image, $log, $avaMgr, , $userMgr) =
+ $this->getTestInstances();
+
+ $config->expects($this->once())
+ ->method('setUserValue');
+
+ $user = new User(
+ 'user', 'cn=user', $access, $config, $filesys, $image, $log, $avaMgr, $userMgr);
+
+ $displayName = $user->composeAndStoreDisplayName($part1, $part2);
+ $this->assertSame($expected, $displayName);
+ }
}