Skip to content

Commit

Permalink
Merge pull request #52 from silinternational/feature/compensate-for-f…
Browse files Browse the repository at this point in the history
…ullname-bug

Ensure fullName matches first and last names concatenated if missing
  • Loading branch information
mtompset authored May 16, 2022
2 parents 59db342 + c5b0387 commit 53516f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SilMock/Google/Service/Directory/UsersResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ public function listUsers($parameters = [])
$userEntry = json_decode($userRecord['data'], true);
if ($this->doesUserMatch($userEntry, $parameters['query'])) {
/** @var \Google_Service_Directory_UserName $newName */
$newName = new \Google_Service_Directory_UserName(array(
$newName = new \Google_Service_Directory_UserName([
'familyName' => $userEntry['name']['familyName'],
'fullName' => $userEntry['name']['fullName'],
'fullName' =>
$userEntry['name']['fullName'] ??
$userEntry['name']['givenName'] . ' ' . $userEntry['name']['familyName'],
'givenName' => $userEntry['name']['givenName'],
));
]);
/** @var \Google_Service_Directory_User $newEntry */
$newEntry = new \Google_Service_Directory_User(array(
'primaryEmail' => $userEntry['primaryEmail'],
Expand Down

0 comments on commit 53516f6

Please sign in to comment.