Skip to content

Commit f5a9dd9

Browse files
committed
Fix tests due to config adjustments
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 2f482db commit f5a9dd9

3 files changed

Lines changed: 45 additions & 37 deletions

File tree

3rdparty

Submodule 3rdparty updated 890 files

apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,9 @@ public function testSearchPrincipals($sharingEnabled, $groupsOnly, $test, $resul
431431
->will($this->returnValue($sharingEnabled));
432432

433433
if ($sharingEnabled) {
434-
$this->config->expects($this->once())
435-
->method('getAppValue')
436-
->with('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')
437-
->willReturn('yes');
434+
$this->shareManager->expects($this->once())
435+
->method('allowEnumeration')
436+
->willReturn(true);
438437

439438
$this->shareManager->expects($this->once())
440439
->method('shareWithGroupMembersOnly')
@@ -526,10 +525,9 @@ public function testSearchPrincipalByCalendarUserAddressSet() {
526525
->method('shareAPIEnabled')
527526
->will($this->returnValue(true));
528527

529-
$this->config->expects($this->exactly(2))
530-
->method('getAppValue')
531-
->with('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')
532-
->willReturn('yes');
528+
$this->shareManager->expects($this->exactly(2))
529+
->method('allowEnumeration')
530+
->willReturn(true);
533531

534532
$this->shareManager->expects($this->exactly(2))
535533
->method('shareWithGroupMembersOnly')
@@ -557,10 +555,9 @@ public function testSearchPrincipalWithEnumerationDisabledDisplayname() {
557555
->method('shareAPIEnabled')
558556
->will($this->returnValue(true));
559557

560-
$this->config->expects($this->once())
561-
->method('getAppValue')
562-
->with('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')
563-
->willReturn('no');
558+
$this->shareManager->expects($this->once())
559+
->method('allowEnumeration')
560+
->willReturn(false);
564561

565562
$this->shareManager->expects($this->once())
566563
->method('shareWithGroupMembersOnly')
@@ -593,10 +590,9 @@ public function testSearchPrincipalWithEnumerationDisabledEmail() {
593590
->method('shareAPIEnabled')
594591
->will($this->returnValue(true));
595592

596-
$this->config->expects($this->once())
597-
->method('getAppValue')
598-
->with('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes')
599-
->willReturn('no');
593+
$this->shareManager->expects($this->once())
594+
->method('allowEnumeration')
595+
->willReturn(false);
600596

601597
$this->shareManager->expects($this->once())
602598
->method('shareWithGroupMembersOnly')

apps/settings/tests/Settings/Admin/SharingTest.php

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,55 +94,60 @@ public function testGetFormWithoutExcludedGroups() {
9494
$this->config
9595
->expects($this->at(6))
9696
->method('getAppValue')
97+
->with('core', 'shareapi_restrict_user_enumeration_to_group', 'no')
98+
->willReturn('no');
99+
$this->config
100+
->expects($this->at(7))
101+
->method('getAppValue')
97102
->with('core', 'shareapi_enabled', 'yes')
98103
->willReturn('yes');
99104
$this->config
100-
->expects($this->at(7))
105+
->expects($this->at(8))
101106
->method('getAppValue')
102107
->with('core', 'shareapi_default_expire_date', 'no')
103108
->willReturn('no');
104109
$this->config
105-
->expects($this->at(8))
110+
->expects($this->at(9))
106111
->method('getAppValue')
107112
->with('core', 'shareapi_expire_after_n_days', '7')
108113
->willReturn('7');
109114
$this->config
110-
->expects($this->at(9))
115+
->expects($this->at(10))
111116
->method('getAppValue')
112117
->with('core', 'shareapi_enforce_expire_date', 'no')
113118
->willReturn('no');
114119
$this->config
115-
->expects($this->at(10))
120+
->expects($this->at(11))
116121
->method('getAppValue')
117122
->with('core', 'shareapi_exclude_groups', 'no')
118123
->willReturn('no');
119124
$this->config
120-
->expects($this->at(11))
125+
->expects($this->at(12))
121126
->method('getAppValue')
122127
->with('core', 'shareapi_public_link_disclaimertext', null)
123128
->willReturn('Lorem ipsum');
124129
$this->config
125-
->expects($this->at(12))
130+
->expects($this->at(13))
126131
->method('getAppValue')
127132
->with('core', 'shareapi_enable_link_password_by_default', 'no')
128133
->willReturn('yes');
129134
$this->config
130-
->expects($this->at(13))
135+
->expects($this->at(14))
131136
->method('getAppValue')
132137
->with('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL)
133138
->willReturn(Constants::PERMISSION_ALL);
134139
$this->config
135-
->expects($this->at(14))
140+
->expects($this->at(15))
136141
->method('getAppValue')
137142
->with('core', 'shareapi_default_internal_expire_date', 'no')
138143
->willReturn('no');
139144
$this->config
140-
->expects($this->at(15))
145+
->expects($this->at(16))
141146
->method('getAppValue')
142147
->with('core', 'shareapi_internal_expire_after_n_days', '7')
143148
->willReturn('7');
144149
$this->config
145-
->expects($this->at(16))
150+
->expects($this->at(17))
146151
->method('getAppValue')
147152
->with('core', 'shareapi_enforce_internal_expire_date', 'no')
148153
->willReturn('no');
@@ -156,6 +161,7 @@ public function testGetFormWithoutExcludedGroups() {
156161
'allowPublicUpload' => 'yes',
157162
'allowResharing' => 'yes',
158163
'allowShareDialogUserEnumeration' => 'yes',
164+
'restrictUserEnumerationToGroup' => 'no',
159165
'enforceLinkPassword' => false,
160166
'onlyShareWithGroupMembers' => false,
161167
'shareAPIEnabled' => 'yes',
@@ -212,55 +218,60 @@ public function testGetFormWithExcludedGroups() {
212218
$this->config
213219
->expects($this->at(6))
214220
->method('getAppValue')
221+
->with('core', 'shareapi_restrict_user_enumeration_to_group', 'no')
222+
->willReturn('no');
223+
$this->config
224+
->expects($this->at(7))
225+
->method('getAppValue')
215226
->with('core', 'shareapi_enabled', 'yes')
216227
->willReturn('yes');
217228
$this->config
218-
->expects($this->at(7))
229+
->expects($this->at(8))
219230
->method('getAppValue')
220231
->with('core', 'shareapi_default_expire_date', 'no')
221232
->willReturn('no');
222233
$this->config
223-
->expects($this->at(8))
234+
->expects($this->at(9))
224235
->method('getAppValue')
225236
->with('core', 'shareapi_expire_after_n_days', '7')
226237
->willReturn('7');
227238
$this->config
228-
->expects($this->at(9))
239+
->expects($this->at(10))
229240
->method('getAppValue')
230241
->with('core', 'shareapi_enforce_expire_date', 'no')
231242
->willReturn('no');
232243
$this->config
233-
->expects($this->at(10))
244+
->expects($this->at(11))
234245
->method('getAppValue')
235246
->with('core', 'shareapi_exclude_groups', 'no')
236247
->willReturn('yes');
237248
$this->config
238-
->expects($this->at(11))
249+
->expects($this->at(12))
239250
->method('getAppValue')
240251
->with('core', 'shareapi_public_link_disclaimertext', null)
241252
->willReturn('Lorem ipsum');
242253
$this->config
243-
->expects($this->at(12))
254+
->expects($this->at(13))
244255
->method('getAppValue')
245256
->with('core', 'shareapi_enable_link_password_by_default', 'no')
246257
->willReturn('yes');
247258
$this->config
248-
->expects($this->at(13))
259+
->expects($this->at(14))
249260
->method('getAppValue')
250261
->with('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL)
251262
->willReturn(Constants::PERMISSION_ALL);
252263
$this->config
253-
->expects($this->at(14))
264+
->expects($this->at(15))
254265
->method('getAppValue')
255266
->with('core', 'shareapi_default_internal_expire_date', 'no')
256267
->willReturn('no');
257268
$this->config
258-
->expects($this->at(15))
269+
->expects($this->at(16))
259270
->method('getAppValue')
260271
->with('core', 'shareapi_internal_expire_after_n_days', '7')
261272
->willReturn('7');
262273
$this->config
263-
->expects($this->at(16))
274+
->expects($this->at(17))
264275
->method('getAppValue')
265276
->with('core', 'shareapi_enforce_internal_expire_date', 'no')
266277
->willReturn('no');
@@ -275,6 +286,7 @@ public function testGetFormWithExcludedGroups() {
275286
'allowPublicUpload' => 'yes',
276287
'allowResharing' => 'yes',
277288
'allowShareDialogUserEnumeration' => 'yes',
289+
'restrictUserEnumerationToGroup' => 'no',
278290
'enforceLinkPassword' => false,
279291
'onlyShareWithGroupMembers' => false,
280292
'shareAPIEnabled' => 'yes',

0 commit comments

Comments
 (0)