Skip to content

Commit abe6796

Browse files
committed
test(php): Fix the unit tests
I added our context in the unit tests following the advice of Louis. Link : nextcloud#43186 (comment) Signed-off-by: Baptiste Fotia <fotia.baptiste@hotmail.com>
1 parent 82583ee commit abe6796

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

apps/settings/tests/Settings/Admin/SharingTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public function testGetFormWithoutExcludedGroups(): void {
118118
['core', 'shareapi_remote_expire_after_n_days', '7', '7'],
119119
['core', 'shareapi_enforce_remote_expire_date', 'no', 'no'],
120120
['core', 'shareapi_enforce_links_password_excluded_groups', '', ''],
121+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
121122
]);
122123
$this->shareManager->method('shareWithGroupMembersOnly')
123124
->willReturn(false);
@@ -210,6 +211,7 @@ public function testGetFormWithExcludedGroups(): void {
210211
['core', 'shareapi_remote_expire_after_n_days', '7', '7'],
211212
['core', 'shareapi_enforce_remote_expire_date', 'no', 'no'],
212213
['core', 'shareapi_enforce_links_password_excluded_groups', '', ''],
214+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
213215
]);
214216
$this->shareManager->method('shareWithGroupMembersOnly')
215217
->willReturn(false);

tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public function testGetContactsWhenUserIsInExcludeGroups() {
217217
['core', 'shareapi_exclude_groups', 'no', 'yes'],
218218
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
219219
['core', 'shareapi_exclude_groups_list', '', '["group1", "group5", "group6"]'],
220+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
220221
]);
221222

222223
/** @var IUser|MockObject $currentUser */
@@ -260,6 +261,7 @@ public function testGetContactsOnlyShareIfInTheSameGroup() {
260261
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'],
261262
['core', 'shareapi_exclude_groups', 'no', 'no'],
262263
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
264+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
263265
]);
264266

265267
/** @var IUser|MockObject $currentUser */
@@ -334,6 +336,7 @@ public function testGetContactsOnlyEnumerateIfInTheSameGroup() {
334336
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'],
335337
['core', 'shareapi_exclude_groups', 'no', 'no'],
336338
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
339+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
337340
]);
338341

339342
/** @var IUser|MockObject $currentUser */
@@ -466,6 +469,7 @@ public function testGetContactsOnlyEnumerateIfPhoneBookMatchWithOwnGroupsOnly()
466469
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'yes'],
467470
['core', 'shareapi_exclude_groups', 'no', 'no'],
468471
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
472+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
469473
]);
470474

471475
/** @var IUser|MockObject $currentUser */
@@ -619,6 +623,7 @@ public function testGetContactsOnlyEnumerateIfPhoneBookOrSameGroupInOwnGroupsOnl
619623
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'yes'],
620624
['core', 'shareapi_exclude_groups', 'no', 'no'],
621625
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
626+
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
622627
]);
623628

624629
/** @var IUser|MockObject $currentUser */

0 commit comments

Comments
 (0)