Skip to content

Commit

Permalink
Merge pull request #119 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 2.13.1: Fix aliases returned by groups.list
  • Loading branch information
mtompset authored Dec 11, 2024
2 parents dca71f1 + 085200a commit 1722995
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions SilMock/Google/Service/Directory/Resource/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ public function listGroups($optParams = []): GoogleDirectory_Groups
if (0 < $currentResultSize && $currentResultSize <= $pageSize) {
$groups->setNextPageToken(sprintf("%d", $pageToken + 1));
}
// Thankfully, setting the aliases in the loop
// fixes the empty aliases in groups.
foreach ($groups->getGroups() as $group) {
$mockGroupsAliasesObject = new GroupsAliases($this->dbFile);
$aliasesObject = $mockGroupsAliasesObject->listGroupsAliases($group->getEmail());
$aliasesObjectArray = $aliasesObject->getAliases();
$aliases = array_map(function (GoogleDirectory_GroupAlias $alias) { return $alias->getAlias(); }, $aliasesObjectArray);
$group->setAliases($aliases);
}
return $groups;
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "silinternational/google-api-php-client-mock",
"version": "2.13.0",
"version": "2.13.1",
"description": "Attempting to create an intelligent mock of the Google API PHP Client for unit and functional testing.",
"type": "library",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1722995

Please sign in to comment.