From 384a1d34a8d9daf0b03e0a43e033f3389f5fe28d Mon Sep 17 00:00:00 2001 From: Glandos Date: Thu, 3 Nov 2022 23:27:55 +0100 Subject: adapt test to new workflow getDirectoryListing should return all files getFile is not called anymore Signed-off-by: Glandos --- tests/lib/Preview/GeneratorTest.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php index 1f6f43dce1e..37fc3935139 100644 --- a/tests/lib/Preview/GeneratorTest.php +++ b/tests/lib/Preview/GeneratorTest.php @@ -105,15 +105,12 @@ class GeneratorTest extends \Test\TestCase { $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') @@ -344,14 +341,12 @@ class GeneratorTest extends \Test\TestCase { $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'); -- cgit v1.2.3