Преглед изворни кода

test(php): Fix the unit tests

I added our context in the unit tests following the advice of Louis.

Link : https://github.com/nextcloud/server/pull/43186#issuecomment-1916571027

Signed-off-by: Baptiste Fotia <fotia.baptiste@hotmail.com>
tags/v29.0.0beta1
Baptiste Fotia пре 4 месеци
родитељ
комит
449d28e610

+ 2
- 0
apps/settings/tests/Settings/Admin/SharingTest.php Прегледај датотеку

@@ -118,6 +118,7 @@ class SharingTest extends TestCase {
['core', 'shareapi_remote_expire_after_n_days', '7', '7'],
['core', 'shareapi_enforce_remote_expire_date', 'no', 'no'],
['core', 'shareapi_enforce_links_password_excluded_groups', '', ''],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);
$this->shareManager->method('shareWithGroupMembersOnly')
->willReturn(false);
@@ -210,6 +211,7 @@ class SharingTest extends TestCase {
['core', 'shareapi_remote_expire_after_n_days', '7', '7'],
['core', 'shareapi_enforce_remote_expire_date', 'no', 'no'],
['core', 'shareapi_enforce_links_password_excluded_groups', '', ''],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);
$this->shareManager->method('shareWithGroupMembersOnly')
->willReturn(false);

+ 5
- 0
tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php Прегледај датотеку

@@ -217,6 +217,7 @@ class ContactsStoreTest extends TestCase {
['core', 'shareapi_exclude_groups', 'no', 'yes'],
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
['core', 'shareapi_exclude_groups_list', '', '["group1", "group5", "group6"]'],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);

/** @var IUser|MockObject $currentUser */
@@ -260,6 +261,7 @@ class ContactsStoreTest extends TestCase {
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'],
['core', 'shareapi_exclude_groups', 'no', 'no'],
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);

/** @var IUser|MockObject $currentUser */
@@ -334,6 +336,7 @@ class ContactsStoreTest extends TestCase {
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'no'],
['core', 'shareapi_exclude_groups', 'no', 'no'],
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);

/** @var IUser|MockObject $currentUser */
@@ -466,6 +469,7 @@ class ContactsStoreTest extends TestCase {
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'yes'],
['core', 'shareapi_exclude_groups', 'no', 'no'],
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);

/** @var IUser|MockObject $currentUser */
@@ -619,6 +623,7 @@ class ContactsStoreTest extends TestCase {
['core', 'shareapi_restrict_user_enumeration_to_phone', 'no', 'yes'],
['core', 'shareapi_exclude_groups', 'no', 'no'],
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
['core', 'shareapi_only_share_with_group_members_exclude_group_list', '', '[]'],
]);

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

Loading…
Откажи
Сачувај