public function testGetSmallImageUrl()
 {
     /** @var $product \Magento\Catalog\Model\Product */
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $this->assertStringEndsWith('placeholder/small_image.jpg', $this->_helper->getSmallImageUrl($product));
     $product->setSmallImage('test_image.png');
     $this->assertStringEndsWith('/test_image.png', $this->_helper->getSmallImageUrl($product));
 }
示例#2
0
 /**
  * Item data.
  *
  * @return array
  */
 public function getData()
 {
     $productItemData = ['id' => $this->product->getId(), 'name' => $this->product->getName(), 'price' => $this->getProductPrice(), 'image' => $this->productHelper->getSmallImageUrl($this->product), 'score' => $this->product->getDocumentScore(), 'is_in_stock' => $this->isInStockProduct()];
     return $productItemData;
 }