@@ -261,8 +261,12 @@ public function testShowShare(): void {
261261				['files_sharing.sharecontroller.showShare ' , ['token '  => 'token ' ], 'shareUrl ' ],
262262				// this share is not an image to the default preview is used 
263263				['files_sharing.PublicPreview.getPreview ' , ['x '  => 256 , 'y '  => 256 , 'file '  => $ share ->getTarget (), 'token '  => 'token ' ], 'previewUrl ' ],
264- 				// for the direct link 
265- 				['files_sharing.sharecontroller.downloadShare ' , ['token '  => 'token ' , 'filename '  => $ filename  ], 'downloadUrl ' ],
264+ 			]);
265+ 
266+ 		$ this  ->urlGenerator ->expects ($ this  ->once ())
267+ 			->method ('getAbsoluteURL ' )
268+ 			->willReturnMap ([
269+ 				['/public.php/dav/files/token/?accept=zip ' , 'downloadUrl ' ],
266270			]);
267271
268272		$ this  ->previewManager ->method ('isMimeSupported ' )->with ('text/plain ' )->willReturn (true );
@@ -552,8 +556,12 @@ public function testShowShareWithPrivateName(): void {
552556				['files_sharing.sharecontroller.showShare ' , ['token '  => 'token ' ], 'shareUrl ' ],
553557				// this share is not an image to the default preview is used 
554558				['files_sharing.PublicPreview.getPreview ' , ['x '  => 256 , 'y '  => 256 , 'file '  => $ share ->getTarget (), 'token '  => 'token ' ], 'previewUrl ' ],
555- 				// for the direct link 
556- 				['files_sharing.sharecontroller.downloadShare ' , ['token '  => 'token ' , 'filename '  => $ filename  ], 'downloadUrl ' ],
559+ 			]);
560+ 
561+ 		$ this  ->urlGenerator ->expects ($ this  ->once ())
562+ 			->method ('getAbsoluteURL ' )
563+ 			->willReturnMap ([
564+ 				['/public.php/dav/files/token/?accept=zip ' , 'downloadUrl ' ],
557565			]);
558566
559567		$ this  ->previewManager ->method ('isMimeSupported ' )->with ('text/plain ' )->willReturn (true );
0 commit comments