diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index f837850e0a52..a23a7237fb03 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -85,7 +85,7 @@ public function getCreatedGroups() { * returns the display name of the current user * if no "Display Name" is set the user-name is returned instead * - * @return array + * @return string */ public function getCurrentUserDisplayName() { return $this->getUserDisplayName($this->getCurrentUser()); @@ -93,18 +93,20 @@ public function getCurrentUserDisplayName() { /** * returns the display name of a user - * if no "Display Name" is set the user-name is returned instead + * if no "Display Name" is set the username is returned instead * * @param string $username * - * @return array + * @return string */ public function getUserDisplayName($username) { - $displayName = $this->createdUsers[$username]['displayname']; - if (($displayName === null) || ($displayName === '')) { - $displayName = $username; + if (isset($this->createdUsers[$username]['displayname'])) { + $displayName = (string) $this->createdUsers[$username]['displayname']; + if ($displayName !== '') { + return $displayName; + } } - return $displayName; + return $username; } /**