Skip to content

Commit

Permalink
magento#28239: resize command does not process hidden images
Browse files Browse the repository at this point in the history
- Fixed Unit Test
  • Loading branch information
BGorbach committed Jul 13, 2021
1 parent d16ee89 commit 788b2fc
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ protected function setUp(): void
->willReturnOnConsecutiveCalls($this->testfilepath, $this->testImageHiddenfilepath);
$this->mediaDirectoryMock->expects($this->any())
->method('getRelativePath')
->willReturnOnConsecutiveCalls($this->testfilepath, $this->testImageHiddenfilepath)
->willReturnOnConsecutiveCalls($this->testfilepath, $this->testImageHiddenfilepath);

$this->viewMock->expects($this->any())
Expand Down Expand Up @@ -418,13 +417,13 @@ public function testResizeFromImageNameMediaStorageDatabase()
->willReturn(false);

$imageMock = $this->createMock(Image::class);
$this->imageFactoryMock->expects($this->any())
$this->imageFactoryMock->expects($this->once())
->method('create')
->willReturn($imageMock);

$this->mediaDirectoryMock->expects($this->any())
->method('isFile')
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath])
->with($this->testfilepath)
->willReturnOnConsecutiveCalls(
$this->returnValue(false),
$this->returnValue(true)
Expand All @@ -441,12 +440,12 @@ public function testResizeFromImageNameMediaStorageDatabase()
['0' => []]
);

$this->databaseMock->expects($this->any())
$this->databaseMock->expects($this->once())
->method('saveFileToFilesystem')
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath]);
$this->databaseMock->expects($this->any())
->with($this->testfilepath);
$this->databaseMock->expects($this->once())
->method('saveFile')
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath]);
->with($this->testfilepath);

$this->service->resizeFromImageName($this->testfilename);
}
Expand Down Expand Up @@ -489,7 +488,7 @@ public function testSkipResizingAlreadyResizedImageInDatabase()

$this->mediaDirectoryMock->expects($this->any())
->method('isFile')
->withConsecutive([$this->testfilepath], [$this->testImageHiddenfilepath])
->with($this->testfilepath)
->willReturnOnConsecutiveCalls(
$this->returnValue(false),
$this->returnValue(true)
Expand Down

0 comments on commit 788b2fc

Please sign in to comment.