Skip to content

Commit

Permalink
Make acceptance test function getUserDisplayName more robust
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Davis <[email protected]>
  • Loading branch information
phil-davis committed Jun 13, 2018
1 parent 1cc01ee commit 2683a3b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -97,14 +97,15 @@ public function getCurrentUserDisplayName() {
*
* @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'])) {
if ($this->createdUsers[$username]['displayname'] != '') {
return $this->createdUsers[$username]['displayname'];
}
}
return $displayName;
return $username;
}

/**
Expand Down

0 comments on commit 2683a3b

Please sign in to comment.