本文整理汇总了PHP中Magento\Catalog\Helper\Image::getResizedImageInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::getResizedImageInfo方法的具体用法?PHP Image::getResizedImageInfo怎么用?PHP Image::getResizedImageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Helper\Image
的用法示例。
在下文中一共展示了Image::getResizedImageInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetResizedImageInfo
/**
* @param string $imageId
* @param string $imageFile
* @param string $baseFile
* @param string $newFile
* @param string $destination
* @param boolean $setImageFile
* @param boolean $isCached
* @param boolean $isBaseFilePlaceholder
* @param array $resizedImageInfo
* @dataProvider getResizedImageInfoDataProvider
*/
public function testGetResizedImageInfo($imageId, $imageFile, $baseFile, $newFile, $destination, $setImageFile, $isCached, $isBaseFilePlaceholder, $resizedImageInfo)
{
$productMock = $this->getMockBuilder('Magento\\Catalog\\Model\\Product')->disableOriginalConstructor()->getMock();
$productMock->expects($this->any())->method('getData')->with($destination)->willReturn($imageFile);
$this->image->expects($this->any())->method('setBaseFile')->with($imageFile)->willReturnSelf();
$this->image->expects($this->once())->method('getBaseFile')->willReturn($baseFile);
$this->image->expects($this->any())->method('getDestinationSubdir')->willReturn($destination);
$this->image->expects($this->any())->method('isCached')->willReturn($isCached);
$this->image->expects($this->any())->method('resize')->willReturnSelf();
$this->image->expects($this->any())->method('saveFile')->willReturnSelf();
$this->image->expects($this->once())->method('getResizedImageInfo')->willReturn($resizedImageInfo);
$this->image->expects($this->any())->method('isBaseFilePlaceholder')->willReturn($isBaseFilePlaceholder);
$this->image->expects($this->any())->method('getNewFile')->willReturn($newFile);
$this->prepareAttributes([], $imageId);
$this->helper->init($productMock, $imageId);
if ($setImageFile) {
$this->helper->setImageFile($imageFile);
}
$result = $this->helper->getResizedImageInfo();
$this->assertEquals($resizedImageInfo, $result);
}
示例2: getResizedImageInfo
/**
* Return resized product image information
*
* @return array
*/
public function getResizedImageInfo()
{
return $this->_helperImage->getResizedImageInfo();
}