diff --git a/SilMock/Google/Service/Directory/Resource/Groups.php b/SilMock/Google/Service/Directory/Resource/Groups.php index 31dd654..b97b549 100644 --- a/SilMock/Google/Service/Directory/Resource/Groups.php +++ b/SilMock/Google/Service/Directory/Resource/Groups.php @@ -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; } diff --git a/composer.json b/composer.json index 9fc069b..97c379e 100644 --- a/composer.json +++ b/composer.json @@ -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": [ diff --git a/composer.lock b/composer.lock index 0093d28..9258af0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "08c15db16ea28b2055642d25c855bc2f", + "content-hash": "98589aa7e195a743dcf2387f4ae0d570", "packages": [ { "name": "firebase/php-jwt",