@@ -156,7 +156,7 @@ public function testShareNoDownloadButPreviewHeader() {
156156 $ preview ->method ('getMimeType ' )
157157 ->willReturn ('myMime ' );
158158
159- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
159+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true , false );
160160 $ expected = new FileDisplayResponse ($ preview , Http::STATUS_OK , ['Content-Type ' => 'myMime ' ]);
161161 $ expected ->cacheFor (15 * 60 );
162162 $ this ->assertEquals ($ expected , $ res );
@@ -192,7 +192,7 @@ public function testShareWithAttributes() {
192192 $ preview ->method ('getMimeType ' )
193193 ->willReturn ('myMime ' );
194194
195- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
195+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true , false );
196196 $ expected = new FileDisplayResponse ($ preview , Http::STATUS_OK , ['Content-Type ' => 'myMime ' ]);
197197 $ expected ->cacheFor (3600 * 24 );
198198 $ this ->assertEquals ($ expected , $ res );
@@ -224,7 +224,7 @@ public function testPreviewFile() {
224224 $ preview ->method ('getMimeType ' )
225225 ->willReturn ('myMime ' );
226226
227- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
227+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true , false );
228228 $ expected = new FileDisplayResponse ($ preview , Http::STATUS_OK , ['Content-Type ' => 'myMime ' ]);
229229 $ expected ->cacheFor (3600 * 24 );
230230 $ this ->assertEquals ($ expected , $ res );
@@ -250,7 +250,7 @@ public function testPreviewFolderInvalidFile(): void {
250250 ->with ($ this ->equalTo ('file ' ))
251251 ->willThrowException (new NotFoundException ());
252252
253- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
253+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true , false );
254254 $ expected = new DataResponse ([], Http::STATUS_NOT_FOUND );
255255 $ this ->assertEquals ($ expected , $ res );
256256 }
@@ -271,7 +271,7 @@ public function testPreviewFolderEmptyFileReturnsBadRequest(): void {
271271 $ share ->method ('canSeeContent ' )
272272 ->willReturn (true );
273273
274- $ res = $ this ->controller ->getPreview ('token ' , '' , 10 , 10 , true );
274+ $ res = $ this ->controller ->getPreview ('token ' , '' , 10 , 10 , false , false );
275275 $ expected = new DataResponse ([], Http::STATUS_BAD_REQUEST );
276276 $ this ->assertEquals ($ expected , $ res );
277277 }
@@ -299,7 +299,7 @@ public function testPreviewFolderInvalidFileWithMimeFallbackReturnsNotFound(): v
299299 $ this ->mimeIconProvider ->expects ($ this ->never ())
300300 ->method ('getMimeIconUrl ' );
301301
302- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
302+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , false , true );
303303 $ expected = new DataResponse ([], Http::STATUS_NOT_FOUND );
304304 $ this ->assertEquals ($ expected , $ res );
305305 }
@@ -336,7 +336,7 @@ public function testPreviewFolderValidFileMimeFallbackRedirectsWhenPreviewMissin
336336 ->with ('text/plain ' )
337337 ->willReturn ('/icon-url ' );
338338
339- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
339+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , false , true );
340340 $ expected = new RedirectResponse ('/icon-url ' );
341341 $ this ->assertEquals ($ expected , $ res );
342342 }
@@ -372,7 +372,7 @@ public function testPreviewFolderValidFile(): void {
372372 $ preview ->method ('getMimeType ' )
373373 ->willReturn ('myMime ' );
374374
375- $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true );
375+ $ res = $ this ->controller ->getPreview ('token ' , 'file ' , 10 , 10 , true , false );
376376 $ expected = new FileDisplayResponse ($ preview , Http::STATUS_OK , ['Content-Type ' => 'myMime ' ]);
377377 $ expected ->cacheFor (3600 * 24 );
378378 $ this ->assertEquals ($ expected , $ res );
0 commit comments