aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-11-21 17:50:17 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-11-21 17:51:34 +0100
commit281cbbfa97ad9429384118fbb7efac3952a2ddef (patch)
tree4a5adbaf93f8b3231882d76dfaaa9064fc599622 /apps/settings/tests
parent7984b80a764a8c73fb1d4521523b7107fc31a61a (diff)
downloadnextcloud-server-281cbbfa97ad9429384118fbb7efac3952a2ddef.tar.gz
nextcloud-server-281cbbfa97ad9429384118fbb7efac3952a2ddef.zip
Fix tests for apps/settings new section
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings/tests')
-rw-r--r--apps/settings/tests/Settings/Admin/SharingTest.php148
1 files changed, 76 insertions, 72 deletions
diff --git a/apps/settings/tests/Settings/Admin/SharingTest.php b/apps/settings/tests/Settings/Admin/SharingTest.php
index 2a8a7fed245..b34c4945774 100644
--- a/apps/settings/tests/Settings/Admin/SharingTest.php
+++ b/apps/settings/tests/Settings/Admin/SharingTest.php
@@ -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,
+ ]
],
);