Skip to content
Merged
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
Next Next 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 authored and szaimen committed Apr 17, 2023
commit 384a1d34a8d9daf0b03e0a43e033f3389f5fe28d
19 changes: 7 additions & 12 deletions tests/lib/Preview/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,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 @@ -344,14 +341,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