Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
adapt test to new workflow
getDirectoryListing should return all files
getFile is not called anymore

Signed-off-by: Glandos <[email protected]>
  • Loading branch information
Glandos committed Nov 3, 2022
commit 4608afb39453e51be5d568d6fee03ddd67ab1b18
19 changes: 7 additions & 12 deletions tests/lib/Preview/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,12 @@ public function testGetCachedPreview() {
$maxPreview->method('getMimeType')
->willReturn('image/png');

$previewFolder->method('getDirectoryListing')
->willReturn([$maxPreview]);

$previewFile = $this->createMock(ISimpleFile::class);
$previewFile->method('getSize')->willReturn(1000);
$previewFile->method('getName')->willReturn('256-256.png');

$previewFolder->method('getFile')
->with($this->equalTo('256-256.png'))
->willReturn($previewFile);
$previewFolder->method('getDirectoryListing')
->willReturn([$maxPreview, $previewFile]);

$this->legacyEventDispatcher->expects($this->once())
->method('dispatch')
Expand Down Expand Up @@ -340,14 +337,12 @@ public function testReturnCachedPreviewsWithoutCheckingSupportedMimetype() {
$maxPreview->method('getMimeType')
->willReturn('image/png');

$previewFolder->method('getDirectoryListing')
->willReturn([$maxPreview]);

$preview = $this->createMock(ISimpleFile::class);
$preview->method('getSize')->willReturn(1000);
$previewFolder->method('getFile')
->with($this->equalTo('1024-512-crop.png'))
->willReturn($preview);
$preview->method('getName')->willReturn('1024-512-crop.png');

$previewFolder->method('getDirectoryListing')
->willReturn([$maxPreview, $preview]);

$this->previewManager->expects($this->never())
->method('isMimeSupported');
Expand Down