@@ -106,15 +106,12 @@ public function testGetCachedPreview() {
106106 $ maxPreview ->method ('getMimeType ' )
107107 ->willReturn ('image/png ' );
108108
109- $ previewFolder ->method ('getDirectoryListing ' )
110- ->willReturn ([$ maxPreview ]);
111-
112109 $ previewFile = $ this ->createMock (ISimpleFile::class);
113110 $ previewFile ->method ('getSize ' )->willReturn (1000 );
111+ $ previewFile ->method ('getName ' )->willReturn ('256-256.png ' );
114112
115- $ previewFolder ->method ('getFile ' )
116- ->with ($ this ->equalTo ('256-256.png ' ))
117- ->willReturn ($ previewFile );
113+ $ previewFolder ->method ('getDirectoryListing ' )
114+ ->willReturn ([$ maxPreview , $ previewFile ]);
118115
119116 $ this ->legacyEventDispatcher ->expects ($ this ->once ())
120117 ->method ('dispatch ' )
@@ -340,14 +337,12 @@ public function testReturnCachedPreviewsWithoutCheckingSupportedMimetype() {
340337 $ maxPreview ->method ('getMimeType ' )
341338 ->willReturn ('image/png ' );
342339
343- $ previewFolder ->method ('getDirectoryListing ' )
344- ->willReturn ([$ maxPreview ]);
345-
346340 $ preview = $ this ->createMock (ISimpleFile::class);
347341 $ preview ->method ('getSize ' )->willReturn (1000 );
348- $ previewFolder ->method ('getFile ' )
349- ->with ($ this ->equalTo ('1024-512-crop.png ' ))
350- ->willReturn ($ preview );
342+ $ preview ->method ('getName ' )->willReturn ('1024-512-crop.png ' );
343+
344+ $ previewFolder ->method ('getDirectoryListing ' )
345+ ->willReturn ([$ maxPreview , $ preview ]);
351346
352347 $ this ->previewManager ->expects ($ this ->never ())
353348 ->method ('isMimeSupported ' );
0 commit comments