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