@@ -97,6 +97,7 @@ public function testCheckTokenValidShare(): void {
9797
9898 $ share = $ this ->createMock (IShare::class);
9999 $ share ->method ('getPassword ' )->willReturn (null );
100+ $ share ->method ('isPasswordProtected ' )->willReturn (false );
100101
101102 $ this ->shareManager ->expects ($ this ->once ())
102103 ->method ('getShareByToken ' )
@@ -146,6 +147,7 @@ public function testCheckTokenPasswordNotAuthenticated(): void {
146147
147148 $ share = $ this ->createMock (IShare::class);
148149 $ share ->method ('getPassword ' )->willReturn ('password ' );
150+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
149151 $ share ->method ('getShareType ' )->willReturn (42 );
150152
151153 $ this ->shareManager ->expects ($ this ->once ())
@@ -165,6 +167,7 @@ public function testCheckTokenPasswordAuthenticatedWrongShare(): void {
165167
166168 $ share = $ this ->createMock (IShare::class);
167169 $ share ->method ('getPassword ' )->willReturn ('password ' );
170+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
168171 $ share ->method ('getShareType ' )->willReturn (42 );
169172
170173 $ this ->shareManager ->expects ($ this ->once ())
@@ -199,6 +202,7 @@ public function testShareNoPassword(): void {
199202
200203 $ share = $ this ->createMock (IShare::class);
201204 $ share ->method ('getPassword ' )->willReturn (null );
205+ $ share ->method ('isPasswordProtected ' )->willReturn (false );
202206
203207 $ this ->shareManager ->expects ($ this ->once ())
204208 ->method ('getShareByToken ' )
@@ -216,6 +220,7 @@ public function testSharePasswordFancyShareType(): void {
216220
217221 $ share = $ this ->createMock (IShare::class);
218222 $ share ->method ('getPassword ' )->willReturn ('password ' );
223+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
219224 $ share ->method ('getShareType ' )->willReturn (42 );
220225
221226 $ this ->shareManager ->expects ($ this ->once ())
@@ -234,6 +239,7 @@ public function testSharePasswordRemote(): void {
234239
235240 $ share = $ this ->createMock (IShare::class);
236241 $ share ->method ('getPassword ' )->willReturn ('password ' );
242+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
237243 $ share ->method ('getShareType ' )->willReturn (IShare::TYPE_REMOTE );
238244
239245 $ this ->shareManager ->expects ($ this ->once ())
@@ -252,6 +258,7 @@ public function testSharePasswordLinkValidPassword(): void {
252258
253259 $ share = $ this ->createMock (IShare::class);
254260 $ share ->method ('getPassword ' )->willReturn ('password ' );
261+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
255262 $ share ->method ('getShareType ' )->willReturn (IShare::TYPE_LINK );
256263
257264 $ this ->shareManager ->expects ($ this ->once ())
@@ -276,6 +283,7 @@ public function testSharePasswordMailValidPassword(): void {
276283
277284 $ share = $ this ->createMock (IShare::class);
278285 $ share ->method ('getPassword ' )->willReturn ('password ' );
286+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
279287 $ share ->method ('getShareType ' )->willReturn (IShare::TYPE_EMAIL );
280288
281289 $ this ->shareManager ->expects ($ this ->once ())
@@ -300,6 +308,7 @@ public function testInvalidSharePasswordLinkValidSession(): void {
300308
301309 $ share = $ this ->createMock (IShare::class);
302310 $ share ->method ('getPassword ' )->willReturn ('password ' );
311+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
303312 $ share ->method ('getShareType ' )->willReturn (IShare::TYPE_LINK );
304313 $ share ->method ('getId ' )->willReturn ('42 ' );
305314
@@ -329,6 +338,7 @@ public function testSharePasswordLinkInvalidSession(): void {
329338
330339 $ share = $ this ->createMock (IShare::class);
331340 $ share ->method ('getPassword ' )->willReturn ('password ' );
341+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
332342 $ share ->method ('getShareType ' )->willReturn (IShare::TYPE_LINK );
333343 $ share ->method ('getId ' )->willReturn ('42 ' );
334344
@@ -358,6 +368,7 @@ public function testSharePasswordMailInvalidSession(): void {
358368
359369 $ share = $ this ->createMock (IShare::class);
360370 $ share ->method ('getPassword ' )->willReturn ('password ' );
371+ $ share ->method ('isPasswordProtected ' )->willReturn (true );
361372 $ share ->method ('getShareType ' )->willReturn (IShare::TYPE_EMAIL );
362373 $ share ->method ('getId ' )->willReturn ('42 ' );
363374
0 commit comments