Fix tests for apps/settings new section

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/41637/head
Côme Chilliet 2023-11-21 17:50:17 +07:00
parent 7984b80a76
commit 281cbbfa97
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 76 additions and 72 deletions

@ -124,44 +124,46 @@ class SharingTest extends TestCase {
$this->appManager->method('isEnabledForUser')->with('files_sharing')->willReturn(false);
$this->initialState
->expect($this->once())
->expects($this->exactly(3))
->method('provideInitialState')
->with(
'sharingSettings',
->withConsecutive(
['sharingAppEnabled', false],
['sharingDocumentation', ''],
[
'sharingAppEnabled' => false,
'allowGroupSharing' => 'yes',
'allowLinks' => 'yes',
'allowPublicUpload' => 'yes',
'allowResharing' => 'yes',
'allowShareDialogUserEnumeration' => 'yes',
'restrictUserEnumerationToGroup' => 'no',
'restrictUserEnumerationToPhone' => 'no',
'restrictUserEnumerationFullMatch' => 'yes',
'restrictUserEnumerationFullMatchUserId' => 'yes',
'restrictUserEnumerationFullMatchEmail' => 'yes',
'restrictUserEnumerationFullMatchIgnoreSecondDN' => 'no',
'enforceLinkPassword' => false,
'onlyShareWithGroupMembers' => false,
'shareAPIEnabled' => 'yes',
'shareDefaultExpireDateSet' => 'no',
'shareExpireAfterNDays' => '7',
'shareEnforceExpireDate' => 'no',
'shareExcludeGroups' => false,
'shareExcludedGroupsList' => '',
'publicShareDisclaimerText' => 'Lorem ipsum',
'enableLinkPasswordByDefault' => 'yes',
'shareApiDefaultPermissions' => Constants::PERMISSION_ALL,
'shareApiDefaultPermissionsCheckboxes' => self::invokePrivate($this->admin, 'getSharePermissionList', []),
'shareDefaultInternalExpireDateSet' => 'no',
'shareInternalExpireAfterNDays' => '7',
'shareInternalEnforceExpireDate' => 'no',
'shareDefaultRemoteExpireDateSet' => 'no',
'shareRemoteExpireAfterNDays' => '7',
'shareRemoteEnforceExpireDate' => 'no',
'allowLinksExcludeGroups' => '',
'passwordExcludedGroups' => '',
'passwordExcludedGroupsFeatureEnabled' => false,
'sharingSettings',
[
'allowGroupSharing' => true,
'allowLinks' => true,
'allowPublicUpload' => true,
'allowResharing' => true,
'allowShareDialogUserEnumeration' => true,
'restrictUserEnumerationToGroup' => false,
'restrictUserEnumerationToPhone' => false,
'restrictUserEnumerationFullMatch' => true,
'restrictUserEnumerationFullMatchUserId' => true,
'restrictUserEnumerationFullMatchEmail' => true,
'restrictUserEnumerationFullMatchIgnoreSecondDN' => false,
'enforceLinksPassword' => false,
'onlyShareWithGroupMembers' => false,
'enabled' => true,
'defaultExpireDate' => false,
'expireAfterNDays' => '7',
'enforceExpireDate' => false,
'excludeGroups' => false,
'excludeGroupsList' => [],
'publicShareDisclaimerText' => 'Lorem ipsum',
'enableLinkPasswordByDefault' => true,
'defaultPermissions' => Constants::PERMISSION_ALL,
'defaultInternalExpireDate' => false,
'internalExpireAfterNDays' => '7',
'enforceInternalExpireDate' => false,
'defaultRemoteExpireDate' => false,
'remoteExpireAfterNDays' => '7',
'enforceRemoteExpireDate' => false,
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
]
],
);
@ -213,44 +215,46 @@ class SharingTest extends TestCase {
$this->appManager->method('isEnabledForUser')->with('files_sharing')->willReturn(true);
$this->initialState
->expect($this->once())
->expects($this->exactly(3))
->method('provideInitialState')
->with(
'sharingSettings',
->withConsecutive(
['sharingAppEnabled', true],
['sharingDocumentation', ''],
[
'sharingAppEnabled' => true,
'allowGroupSharing' => 'yes',
'allowLinks' => 'yes',
'allowPublicUpload' => 'yes',
'allowResharing' => 'yes',
'allowShareDialogUserEnumeration' => 'yes',
'restrictUserEnumerationToGroup' => 'no',
'restrictUserEnumerationToPhone' => 'no',
'restrictUserEnumerationFullMatch' => 'yes',
'restrictUserEnumerationFullMatchUserId' => 'yes',
'restrictUserEnumerationFullMatchEmail' => 'yes',
'restrictUserEnumerationFullMatchIgnoreSecondDN' => 'no',
'enforceLinkPassword' => false,
'onlyShareWithGroupMembers' => false,
'shareAPIEnabled' => 'yes',
'shareDefaultExpireDateSet' => 'no',
'shareExpireAfterNDays' => '7',
'shareEnforceExpireDate' => 'no',
'shareExcludeGroups' => true,
'shareExcludedGroupsList' => 'NoSharers|OtherNoSharers',
'publicShareDisclaimerText' => 'Lorem ipsum',
'enableLinkPasswordByDefault' => 'yes',
'shareApiDefaultPermissions' => Constants::PERMISSION_ALL,
'shareApiDefaultPermissionsCheckboxes' => self::invokePrivate($this->admin, 'getSharePermissionList', []),
'shareDefaultInternalExpireDateSet' => 'no',
'shareInternalExpireAfterNDays' => '7',
'shareInternalEnforceExpireDate' => 'no',
'shareDefaultRemoteExpireDateSet' => 'no',
'shareRemoteExpireAfterNDays' => '7',
'shareRemoteEnforceExpireDate' => 'no',
'allowLinksExcludeGroups' => '',
'passwordExcludedGroups' => '',
'passwordExcludedGroupsFeatureEnabled' => false,
'sharingSettings',
[
'allowGroupSharing' => true,
'allowLinks' => true,
'allowPublicUpload' => true,
'allowResharing' => true,
'allowShareDialogUserEnumeration' => true,
'restrictUserEnumerationToGroup' => false,
'restrictUserEnumerationToPhone' => false,
'restrictUserEnumerationFullMatch' => true,
'restrictUserEnumerationFullMatchUserId' => true,
'restrictUserEnumerationFullMatchEmail' => true,
'restrictUserEnumerationFullMatchIgnoreSecondDN' => false,
'enforceLinksPassword' => false,
'onlyShareWithGroupMembers' => false,
'enabled' => true,
'defaultExpireDate' => false,
'expireAfterNDays' => '7',
'enforceExpireDate' => false,
'excludeGroups' => true,
'excludeGroupsList' => ['NoSharers','OtherNoSharers'],
'publicShareDisclaimerText' => 'Lorem ipsum',
'enableLinkPasswordByDefault' => true,
'defaultPermissions' => Constants::PERMISSION_ALL,
'defaultInternalExpireDate' => false,
'internalExpireAfterNDays' => '7',
'enforceInternalExpireDate' => false,
'defaultRemoteExpireDate' => false,
'remoteExpireAfterNDays' => '7',
'enforceRemoteExpireDate' => false,
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
]
],
);