From 7b8f1ca92c1cb9ff0460f29b4d4608d9dca1aa2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 9 Dec 2025 18:39:43 +0100 Subject: [PATCH 1/4] test: Add integration tests for excluded groups in contacts and sharees MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../features/bootstrap/FeatureContext.php | 2 + .../features/bootstrap/ShareesContext.php | 2 + .../features/contacts-menu.feature | 130 ++++++++++++++++++ .../sharees_features/sharees.feature | 75 ++++++++++ 4 files changed, 209 insertions(+) diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index c91c5e7cfa37b..1d6794d67e5e1 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -24,5 +24,7 @@ protected function resetAppConfigs(): void { $this->deleteServerConfig('bruteForce', 'whitelist_0'); $this->deleteServerConfig('bruteForce', 'whitelist_1'); $this->deleteServerConfig('bruteforcesettings', 'apply_allowlist_to_ratelimit'); + $this->deleteServerConfig('core', 'shareapi_exclude_groups'); + $this->deleteServerConfig('core', 'shareapi_exclude_groups_list'); } } diff --git a/build/integration/features/bootstrap/ShareesContext.php b/build/integration/features/bootstrap/ShareesContext.php index e152a749bfa59..745a6248667e5 100644 --- a/build/integration/features/bootstrap/ShareesContext.php +++ b/build/integration/features/bootstrap/ShareesContext.php @@ -21,5 +21,7 @@ protected function resetAppConfigs() { $this->deleteServerConfig('core', 'shareapi_only_share_with_group_members'); $this->deleteServerConfig('core', 'shareapi_allow_share_dialog_user_enumeration'); $this->deleteServerConfig('core', 'shareapi_allow_group_sharing'); + $this->deleteServerConfig('core', 'shareapi_exclude_groups'); + $this->deleteServerConfig('core', 'shareapi_exclude_groups_list'); } } diff --git a/build/integration/features/contacts-menu.feature b/build/integration/features/contacts-menu.feature index bc0094cdddb62..a9f1f9984197d 100644 --- a/build/integration/features/contacts-menu.feature +++ b/build/integration/features/contacts-menu.feature @@ -73,6 +73,136 @@ Feature: contacts-menu + Scenario: users can not be searched by display name when searcher belongs to a group excluded from sharing + Given user "user0" exists + And group "ExcludedGroup" exists + And user "user0" belongs to group "ExcludedGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "yes" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "ExcludedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | displayname | + | value | Test name | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "0" contacts + + Scenario: users can not be searched by email when searcher belongs to a group excluded from sharing + Given user "user0" exists + And group "ExcludedGroup" exists + And user "user0" belongs to group "ExcludedGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "yes" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "ExcludedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | email | + | value | test@example.com | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "0" contacts + + Scenario: users can not be searched by display name when searcher belongs to both a group excluded from sharing and another group + Given user "user0" exists + And group "ExcludedGroup" exists + And user "user0" belongs to group "ExcludedGroup" + And group "AnotherGroup" exists + And user "user0" belongs to group "AnotherGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "yes" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "ExcludedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | displayname | + | value | Test name | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "0" contacts + + Scenario: users can not be searched by email when searcher belongs to both a group excluded from sharing and another group + Given user "user0" exists + And group "ExcludedGroup" exists + And user "user0" belongs to group "ExcludedGroup" + And group "AnotherGroup" exists + And user "user0" belongs to group "AnotherGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "yes" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "ExcludedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | email | + | value | test@example.com | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "0" contacts + + Scenario: users can not be searched by display name when searcher does not belong to a group allowed to share + Given user "user0" exists + And group "AllowedGroup" exists + And parameter "shareapi_exclude_groups" of app "core" is set to "allow" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "AllowedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | displayname | + | value | Test name | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "0" contacts + + Scenario: users can not be searched by email when searcher does not belong to a group allowed to share + Given user "user0" exists + And group "AllowedGroup" exists + And parameter "shareapi_exclude_groups" of app "core" is set to "allow" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "AllowedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | email | + | value | test@example.com | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "0" contacts + + Scenario: users can be searched by display name when searcher belongs to both a group allowed to share and another group + Given user "user0" exists + And group "AllowedGroup" exists + And user "user0" belongs to group "AllowedGroup" + And group "AnotherGroup" exists + And user "user0" belongs to group "AnotherGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "allow" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "AllowedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | displayname | + | value | Test name | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "1" contacts + And searched contact "0" is named "Test name" + + Scenario: users can be searched by email when searcher belongs to both a group allowed to share and another group + Given user "user0" exists + And group "AllowedGroup" exists + And user "user0" belongs to group "AllowedGroup" + And group "AnotherGroup" exists + And user "user0" belongs to group "AnotherGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "allow" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "AllowedGroup" + And user "user1" exists + And As an "admin" + And sending "PUT" to "/cloud/users/user1" with + | key | email | + | value | test@example.com | + When Logging in using web as "user0" + And searching for contacts matching with "test" + Then the list of searched contacts has "1" contacts + And searched contact "0" is named "user1" + + + Scenario: users can not be found by display name if visibility is private Given user "user0" exists And user "user1" exists diff --git a/build/integration/sharees_features/sharees.feature b/build/integration/sharees_features/sharees.feature index 87192dc9cd32e..0cb196d85939c 100644 --- a/build/integration/sharees_features/sharees.feature +++ b/build/integration/sharees_features/sharees.feature @@ -117,6 +117,81 @@ Feature: sharees And "exact remotes" sharees returned is empty And "remotes" sharees returned is empty + Scenario: Search when belonging to a group excluded from sharing + Given As an "test" + And parameter "shareapi_exclude_groups" of app "core" is set to "yes" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "ShareeGroup" + When getting sharees for + | search | sharee | + | itemType | file | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And "exact users" sharees returned is empty + And "users" sharees returned is empty + And "exact groups" sharees returned is empty + And "groups" sharees returned is empty + And "exact remotes" sharees returned is empty + And "remotes" sharees returned is empty + + Scenario: Search when belonging to both a group excluded from sharing and another group + Given As an "test" + And group "AnotherGroup" exists + And user "test" belongs to group "AnotherGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "yes" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "ShareeGroup" + When getting sharees for + | search | sharee | + | itemType | file | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And "exact users" sharees returned is empty + And "users" sharees returned are + | Sharee1 | 0 | Sharee1 | Sharee1 | + | Sharee2 | 0 | Sharee2 | sharee2@system.com | + And "exact groups" sharees returned is empty + And "groups" sharees returned are + | ShareeGroup | 1 | ShareeGroup | + And "exact remotes" sharees returned is empty + And "remotes" sharees returned is empty + + Scenario: Search when not belonging to a group allowed to share + Given As an "test" + And group "AnotherGroup" exists + And parameter "shareapi_exclude_groups" of app "core" is set to "allow" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "AnotherGroup" + When getting sharees for + | search | sharee | + | itemType | file | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And "exact users" sharees returned is empty + And "users" sharees returned is empty + And "exact groups" sharees returned is empty + And "groups" sharees returned is empty + And "exact remotes" sharees returned is empty + And "remotes" sharees returned is empty + + Scenario: Search when belonging to both a group allowed to share and another group + Given As an "test" + And group "AnotherGroup" exists + And user "test" belongs to group "AnotherGroup" + And parameter "shareapi_exclude_groups" of app "core" is set to "allow" + And parameter "shareapi_exclude_groups_list" of app "core" is set to "AnotherGroup" + When getting sharees for + | search | sharee | + | itemType | file | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And "exact users" sharees returned is empty + And "users" sharees returned are + | Sharee1 | 0 | Sharee1 | Sharee1 | + | Sharee2 | 0 | Sharee2 | sharee2@system.com | + And "exact groups" sharees returned is empty + And "groups" sharees returned are + | ShareeGroup | 1 | ShareeGroup | + And "exact remotes" sharees returned is empty + And "remotes" sharees returned is empty + Scenario: Search without exact match no iteration allowed Given As an "test" And parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no" From 53cc490c8f5a2168ea9a8f7210ab992a4d73bb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 9 Dec 2025 18:44:19 +0100 Subject: [PATCH 2/4] test: Adjust unit test name to better reflect its behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php index a3151d0b04096..624a48d04c392 100644 --- a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php +++ b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php @@ -188,7 +188,7 @@ public function testGetContactsWithoutAvatarURI(): void { $this->assertEquals('https://photo', $entries[1]->getAvatar()); } - public function testGetContactsWhenUserIsInExcludeGroups(): void { + public function testGetContactsOnlyShareIfInTheSameGroupWhenUserIsInExcludeGroups(): void { $this->config ->method('getAppValue') ->willReturnMap([ From ca5b838181447d3ee5c8baf20cc2b82345a66f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 9 Dec 2025 18:45:04 +0100 Subject: [PATCH 3/4] test: Add unit test for excluded groups in contacts menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../ContactsMenu/ContactsStoreTest.php | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php index 624a48d04c392..58b29a6152016 100644 --- a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php +++ b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php @@ -188,6 +188,95 @@ public function testGetContactsWithoutAvatarURI(): void { $this->assertEquals('https://photo', $entries[1]->getAvatar()); } + public static function dataGetContactsWhenUserIsInExcludeGroups(): array { + return [ + ['yes', '[]', [], ['user123', 'user12345']], + ['yes', '["excludedGroup1"]', [], ['user123', 'user12345']], + ['yes', '["excludedGroup1"]', ['anotherGroup1'], ['user123', 'user12345']], + ['yes', '["excludedGroup1"]', ['anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], + ['yes', '["excludedGroup1"]', ['excludedGroup1'], []], + ['yes', '["excludedGroup1"]', ['anotherGroup1', 'excludedGroup1'], []], + ['yes', '["excludedGroup1"]', ['excludedGroup1', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', [], ['user123', 'user12345']], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1'], ['user123', 'user12345']], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup1'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup2'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup3'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup1', 'excludedGroup2', 'excludedGroup3'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'excludedGroup1'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'excludedGroup2', 'anotherGroup2', 'anotherGroup3'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup3', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], []], + ['allow', '[]', [], []], + ['allow', '["allowedGroup1"]', [], []], + ['allow', '["allowedGroup1"]', ['anotherGroup1'], []], + ['allow', '["allowedGroup1"]', ['anotherGroup1', 'anotherGroup2', 'anotherGroup3'], []], + ['allow', '["allowedGroup1"]', ['allowedGroup1'], ['user123', 'user12345']], + ['allow', '["allowedGroup1"]', ['anotherGroup1', 'allowedGroup1'], ['user123', 'user12345']], + ['allow', '["allowedGroup1"]', ['allowedGroup1', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', [], []], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['anotherGroup1'], []], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['anotherGroup1', 'anotherGroup2', 'anotherGroup3'], []], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['allowedGroup1'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['allowedGroup2'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['allowedGroup3'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['allowedGroup1', 'allowedGroup2', 'allowedGroup3'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['anotherGroup1', 'allowedGroup1'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['anotherGroup1', 'allowedGroup2', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], + ['allow', '["allowedGroup1", "allowedGroup2", "allowedGroup3"]', ['allowedGroup3', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], + ]; + } + + /** + * @dataProvider dataGetContactsWhenUserIsInExcludeGroups + */ + public function testGetContactsWhenUserIsInExcludeGroups(string $excludeGroups, string $excludeGroupsList, array $currentUserGroupIds, array $expectedUids): void { + $this->config + ->method('getAppValue') + ->willReturnMap([ + ['core', 'shareapi_allow_share_dialog_user_enumeration', 'yes', 'yes'], + ['core', 'shareapi_restrict_user_enumeration_to_group', 'no', 'no'], + ['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'], + ['core', 'shareapi_exclude_groups', 'no', $excludeGroups], + ['core', 'shareapi_only_share_with_group_members', 'no', 'no'], + ['core', 'shareapi_exclude_groups_list', '', $excludeGroupsList], + ['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'], + ]); + + /** @var IUser|MockObject $currentUser */ + $currentUser = $this->createMock(IUser::class); + $currentUser->expects($this->exactly(2)) + ->method('getUID') + ->willReturn('user001'); + + $this->groupManager->expects($this->once()) + ->method('getUserGroupIds') + ->with($this->equalTo($currentUser)) + ->willReturn($currentUserGroupIds); + + $this->contactsManager->expects($this->once()) + ->method('search') + ->with($this->equalTo(''), $this->equalTo(['FN', 'EMAIL'])) + ->willReturn([ + [ + 'UID' => 'user123', + 'isLocalSystemBook' => true + ], + [ + 'UID' => 'user12345', + 'isLocalSystemBook' => true + ], + ]); + + + $entries = $this->contactsStore->getContacts($currentUser, ''); + + $this->assertCount(count($expectedUids), $entries); + for ($i = 0; $i < count($expectedUids); $i++) { + $this->assertEquals($expectedUids[$i], $entries[$i]->getProperty('UID')); + } + } + public function testGetContactsOnlyShareIfInTheSameGroupWhenUserIsInExcludeGroups(): void { $this->config ->method('getAppValue') From b49d406b53a122b10ebf76bc8e51aec6d73d2e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 9 Dec 2025 19:04:55 +0100 Subject: [PATCH 4/4] fix: Unify handling of exclude groups in contacts menu and sharing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the current user belongs to both one or more groups excluded from sharing and one or more groups not excluded from sharing the user is allowed to share. However, in the contacts menu, as soon as the current user belonged to a group excluded from sharing the user could not search for local contacts. This has been unified now with the sharing behaviour, so local contacts can still be searched if the user also belongs to a group not excluded from sharing (or to no group at all, which was also allowed before). Signed-off-by: Daniel Calviño Sánchez --- build/integration/features/contacts-menu.feature | 10 ++++++---- lib/private/Contacts/ContactsMenu/ContactsStore.php | 6 +++--- tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php | 10 +++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build/integration/features/contacts-menu.feature b/build/integration/features/contacts-menu.feature index a9f1f9984197d..0caea2f2f1527 100644 --- a/build/integration/features/contacts-menu.feature +++ b/build/integration/features/contacts-menu.feature @@ -103,7 +103,7 @@ Feature: contacts-menu And searching for contacts matching with "test" Then the list of searched contacts has "0" contacts - Scenario: users can not be searched by display name when searcher belongs to both a group excluded from sharing and another group + Scenario: users can be searched by display name when searcher belongs to both a group excluded from sharing and another group Given user "user0" exists And group "ExcludedGroup" exists And user "user0" belongs to group "ExcludedGroup" @@ -118,9 +118,10 @@ Feature: contacts-menu | value | Test name | When Logging in using web as "user0" And searching for contacts matching with "test" - Then the list of searched contacts has "0" contacts + Then the list of searched contacts has "1" contacts + And searched contact "0" is named "Test name" - Scenario: users can not be searched by email when searcher belongs to both a group excluded from sharing and another group + Scenario: users can be searched by email when searcher belongs to both a group excluded from sharing and another group Given user "user0" exists And group "ExcludedGroup" exists And user "user0" belongs to group "ExcludedGroup" @@ -135,7 +136,8 @@ Feature: contacts-menu | value | test@example.com | When Logging in using web as "user0" And searching for contacts matching with "test" - Then the list of searched contacts has "0" contacts + Then the list of searched contacts has "1" contacts + And searched contact "0" is named "user1" Scenario: users can not be searched by display name when searcher does not belong to a group allowed to share Given user "user0" exists diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index 5fa25512c97bb..f34e10e85d1ff 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -149,7 +149,7 @@ public function getContacts(IUser $user, ?string $filter, ?int $limit = null, ?i * 1. if the `shareapi_allow_share_dialog_user_enumeration` config option is * enabled it will filter all local users * 2. if the `shareapi_exclude_groups` config option is enabled and the - * current user is in an excluded group it will filter all local users. + * current user is only in excluded groups it will filter all local users. * 3. if the `shareapi_only_share_with_group_members` config option is * enabled it will filter all users which doesn't have a common group * with the current user. @@ -184,8 +184,8 @@ private function filterContacts( $excludeGroupsList = $decodedExcludeGroups ?? []; if ($excludeGroups != 'allow') { - if (count(array_intersect($excludeGroupsList, $selfGroups)) !== 0) { - // a group of the current user is excluded -> filter all local users + if (count($selfGroups) > 0 && count(array_diff($selfGroups, $excludeGroupsList)) === 0) { + // all the groups of the current user are excluded -> filter all local users $skipLocal = true; } } else { diff --git a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php index 58b29a6152016..d10dc9a385475 100644 --- a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php +++ b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php @@ -195,8 +195,8 @@ public static function dataGetContactsWhenUserIsInExcludeGroups(): array { ['yes', '["excludedGroup1"]', ['anotherGroup1'], ['user123', 'user12345']], ['yes', '["excludedGroup1"]', ['anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], ['yes', '["excludedGroup1"]', ['excludedGroup1'], []], - ['yes', '["excludedGroup1"]', ['anotherGroup1', 'excludedGroup1'], []], - ['yes', '["excludedGroup1"]', ['excludedGroup1', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], []], + ['yes', '["excludedGroup1"]', ['anotherGroup1', 'excludedGroup1'], ['user123', 'user12345']], + ['yes', '["excludedGroup1"]', ['excludedGroup1', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', [], ['user123', 'user12345']], ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1'], ['user123', 'user12345']], ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], @@ -204,9 +204,9 @@ public static function dataGetContactsWhenUserIsInExcludeGroups(): array { ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup2'], []], ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup3'], []], ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup1', 'excludedGroup2', 'excludedGroup3'], []], - ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'excludedGroup1'], []], - ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'excludedGroup2', 'anotherGroup2', 'anotherGroup3'], []], - ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup3', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], []], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'excludedGroup1'], ['user123', 'user12345']], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['anotherGroup1', 'excludedGroup2', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], + ['yes', '["excludedGroup1", "excludedGroup2", "excludedGroup3"]', ['excludedGroup3', 'anotherGroup1', 'anotherGroup2', 'anotherGroup3'], ['user123', 'user12345']], ['allow', '[]', [], []], ['allow', '["allowedGroup1"]', [], []], ['allow', '["allowedGroup1"]', ['anotherGroup1'], []],