Skip to content

Commit

Permalink
adjust tests to latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
blizzz committed Aug 16, 2016
1 parent 50ebcbd commit a6b9aba
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 20 deletions.
10 changes: 10 additions & 0 deletions tests/lib/Settings/Admin/EncryptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public function testGetFormWithOnlyOneBackend($enabled) {
->expects($this->once())
->method('isReady')
->willReturn($enabled);
$this->manager
->expects($this->once())
->method('getEncryptionModules')
->willReturn([]);
$this->userManager
->expects($this->once())
->method('getBackends')
Expand All @@ -82,6 +86,7 @@ public function testGetFormWithOnlyOneBackend($enabled) {
'encryptionEnabled' => $enabled,
'encryptionReady' => $enabled,
'externalBackendsEnabled' => false,
'encryptionModules' => []
],
''
);
Expand All @@ -101,6 +106,10 @@ public function testGetFormWithMultipleBackends($enabled) {
->expects($this->once())
->method('isReady')
->willReturn($enabled);
$this->manager
->expects($this->once())
->method('getEncryptionModules')
->willReturn([]);
$this->userManager
->expects($this->once())
->method('getBackends')
Expand All @@ -112,6 +121,7 @@ public function testGetFormWithMultipleBackends($enabled) {
'encryptionEnabled' => $enabled,
'encryptionReady' => $enabled,
'externalBackendsEnabled' => true,
'encryptionModules' => []
],
''
);
Expand Down
128 changes: 108 additions & 20 deletions tests/lib/Settings/Admin/SharingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,60 @@ public function testGetFormWithoutExcludedGroups() {
$this->config
->expects($this->at(1))
->method('getAppValue')
->with('core', 'shareapi_enabled', 'yes')
->with('core', 'shareapi_allow_group_sharing', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('core', 'shareapi_allow_links', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(3))
->method('getAppValue')
->with('core', 'shareapi_allow_mail_notification', 'no')
->willReturn('no');
$this->config
->expects($this->at(4))
->method('getAppValue')
->with('core', 'shareapi_allow_public_notification', 'no')
->willReturn('no');
$this->config
->expects($this->at(5))
->method('getAppValue')
->with('core', 'shareapi_allow_public_upload', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'shareapi_allow_resharing', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(7))
->method('getAppValue')
->with('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(8))
->method('getAppValue')
->with('core', 'shareapi_enabled', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(9))
->method('getAppValue')
->with('core', 'shareapi_default_expire_date', 'no')
->willReturn('no');
$this->config
->expects($this->at(3))
->expects($this->at(10))
->method('getAppValue')
->with('core', 'shareapi_expire_after_n_days', '7')
->willReturn('7');
$this->config
->expects($this->at(4))
->expects($this->at(11))
->method('getAppValue')
->with('core', 'shareapi_enforce_expire_date', 'no')
->willReturn('no');
$this->config
->expects($this->at(5))
->expects($this->at(12))
->method('getAppValue')
->with('core', 'shareapi_exclude_groups', 'no')
->willReturn('no');
Expand All @@ -79,12 +114,21 @@ public function testGetFormWithoutExcludedGroups() {
'settings',
'admin/sharing',
[
'shareAPIEnabled' => 'yes',
'shareDefaultExpireDateSet' => 'no',
'shareExpireAfterNDays' => '7',
'shareEnforceExpireDate' => 'no',
'shareExcludeGroups' => false,
'shareExcludedGroupsList' => '',
'allowGroupSharing' => 'yes',
'allowLinks' => 'yes',
'allowMailNotification' => 'no',
'allowPublicMailNotification' => 'no',
'allowPublicUpload' => 'yes',
'allowResharing' => 'yes',
'allowShareDialogUserEnumeration' => 'yes',
'enforceLinkPassword' => false,
'onlyShareWithGroupMembers' => false,
'shareAPIEnabled' => 'yes',
'shareDefaultExpireDateSet' => 'no',
'shareExpireAfterNDays' => '7',
'shareEnforceExpireDate' => 'no',
'shareExcludeGroups' => false,
'shareExcludedGroupsList' => '',
],
''
);
Expand All @@ -101,25 +145,60 @@ public function testGetFormWithExcludedGroups() {
$this->config
->expects($this->at(1))
->method('getAppValue')
->with('core', 'shareapi_enabled', 'yes')
->with('core', 'shareapi_allow_group_sharing', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('core', 'shareapi_allow_links', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(3))
->method('getAppValue')
->with('core', 'shareapi_allow_mail_notification', 'no')
->willReturn('no');
$this->config
->expects($this->at(4))
->method('getAppValue')
->with('core', 'shareapi_allow_public_notification', 'no')
->willReturn('no');
$this->config
->expects($this->at(5))
->method('getAppValue')
->with('core', 'shareapi_allow_public_upload', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'shareapi_allow_resharing', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(7))
->method('getAppValue')
->with('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(8))
->method('getAppValue')
->with('core', 'shareapi_enabled', 'yes')
->willReturn('yes');
$this->config
->expects($this->at(9))
->method('getAppValue')
->with('core', 'shareapi_default_expire_date', 'no')
->willReturn('no');
$this->config
->expects($this->at(3))
->expects($this->at(10))
->method('getAppValue')
->with('core', 'shareapi_expire_after_n_days', '7')
->willReturn('7');
$this->config
->expects($this->at(4))
->expects($this->at(11))
->method('getAppValue')
->with('core', 'shareapi_enforce_expire_date', 'no')
->willReturn('no');
$this->config
->expects($this->at(5))
->expects($this->at(12))
->method('getAppValue')
->with('core', 'shareapi_exclude_groups', 'no')
->willReturn('yes');
Expand All @@ -128,12 +207,21 @@ public function testGetFormWithExcludedGroups() {
'settings',
'admin/sharing',
[
'shareAPIEnabled' => 'yes',
'shareDefaultExpireDateSet' => 'no',
'shareExpireAfterNDays' => '7',
'shareEnforceExpireDate' => 'no',
'shareExcludeGroups' => true,
'shareExcludedGroupsList' => 'NoSharers|OtherNoSharers',
'allowGroupSharing' => 'yes',
'allowLinks' => 'yes',
'allowMailNotification' => 'no',
'allowPublicMailNotification' => 'no',
'allowPublicUpload' => 'yes',
'allowResharing' => 'yes',
'allowShareDialogUserEnumeration' => 'yes',
'enforceLinkPassword' => false,
'onlyShareWithGroupMembers' => false,
'shareAPIEnabled' => 'yes',
'shareDefaultExpireDateSet' => 'no',
'shareExpireAfterNDays' => '7',
'shareEnforceExpireDate' => 'no',
'shareExcludeGroups' => true,
'shareExcludedGroupsList' => 'NoSharers|OtherNoSharers',
],
''
);
Expand Down

0 comments on commit a6b9aba

Please sign in to comment.