Skip to content

Commit

Permalink
ACP2E-3127: imagecreatetruecolor(): Argument #2 () must be greater th…
Browse files Browse the repository at this point in the history
…an 0. Can't upload specific image
  • Loading branch information
Chhandak.Barua authored and Chhandak.Barua committed Jul 25, 2024
1 parent fd31d92 commit d52f459
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class StorageTest extends TestCase
*/
private $imagesStorage;

/**
* @var Storage
*/
private $imagesStorageWithZeroHeight;

/**
* @var MockObject
*/
Expand Down Expand Up @@ -294,7 +299,7 @@ function ($path) {

$this->imagesStorage = $this->objectManagerHelper->getObject(
Storage::class,
$this->getStorageClass(100, 50, $allowedExtensions)
$this->getStorageClass(100, 50, $allowedExtensions)
);

$this->imagesStorageWithZeroHeight = $this->objectManagerHelper->getObject(
Expand Down Expand Up @@ -711,7 +716,6 @@ public function testResizeFileWithZeroHeight()
->method('fileGetContents')
->willReturn('some content');


$image = $this->getMockBuilder(image::class)
->disableOriginalConstructor()
->addMethods(['open', 'keepAspectRatio'])
Expand All @@ -721,8 +725,6 @@ public function testResizeFileWithZeroHeight()
$image->expects($this->any())->method('keepAspectRatio')->with(true);
$image->expects($this->once())->method('resize')->with(100, 0)
->willThrowException(new \LogicException($exceptionMessage));


$this->adapterFactoryMock->expects($this->atLeastOnce())->method('create')->willReturn($image);

// Logger should not log any critical errors in this scenario
Expand Down Expand Up @@ -761,5 +763,5 @@ public function getStorageClass($width, $height, $allowedExtensions)
'coreConfig' => $this->coreConfigMock,
'logger' => $this->loggerMock
];
}
}
}

0 comments on commit d52f459

Please sign in to comment.