Skip to content

Commit 788b2fc

Browse files
committed
#28239: resize command does not process hidden images
- Fixed Unit Test
1 parent d16ee89 commit 788b2fc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ protected function setUp(): void
204204
->willReturnOnConsecutiveCalls($this->testfilepath, $this->testImageHiddenfilepath);
205205
$this->mediaDirectoryMock->expects($this->any())
206206
->method('getRelativePath')
207-
->willReturnOnConsecutiveCalls($this->testfilepath, $this->testImageHiddenfilepath)
208207
->willReturnOnConsecutiveCalls($this->testfilepath, $this->testImageHiddenfilepath);
209208

210209
$this->viewMock->expects($this->any())
@@ -418,13 +417,13 @@ public function testResizeFromImageNameMediaStorageDatabase()
418417
->willReturn(false);
419418

420419
$imageMock = $this->createMock(Image::class);
421-
$this->imageFactoryMock->expects($this->any())
420+
$this->imageFactoryMock->expects($this->once())
422421
->method('create')
423422
->willReturn($imageMock);
424423

425424
$this->mediaDirectoryMock->expects($this->any())
426425
->method('isFile')
427-
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath])
426+
->with($this->testfilepath)
428427
->willReturnOnConsecutiveCalls(
429428
$this->returnValue(false),
430429
$this->returnValue(true)
@@ -441,12 +440,12 @@ public function testResizeFromImageNameMediaStorageDatabase()
441440
['0' => []]
442441
);
443442

444-
$this->databaseMock->expects($this->any())
443+
$this->databaseMock->expects($this->once())
445444
->method('saveFileToFilesystem')
446-
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath]);
447-
$this->databaseMock->expects($this->any())
445+
->with($this->testfilepath);
446+
$this->databaseMock->expects($this->once())
448447
->method('saveFile')
449-
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath]);
448+
->with($this->testfilepath);
450449

451450
$this->service->resizeFromImageName($this->testfilename);
452451
}
@@ -489,7 +488,7 @@ public function testSkipResizingAlreadyResizedImageInDatabase()
489488

490489
$this->mediaDirectoryMock->expects($this->any())
491490
->method('isFile')
492-
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath])
491+
->with($this->testfilepath)
493492
->willReturnOnConsecutiveCalls(
494493
$this->returnValue(false),
495494
$this->returnValue(true)

0 commit comments

Comments
 (0)