public function testGetImage() { $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product'); $product->setData('media_gallery', ['images' => ['image' => ['file' => 'magento_image.jpg']]]); $this->assertEquals(['file' => 'magento_image.jpg'], $this->_model->getImage($product, 'magento_image.jpg')); }
/** * {@inheritdoc} */ public function getImage(\Magento\Catalog\Model\Product $product, $file) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getImage'); if (!$pluginInfo) { return parent::getImage($product, $file); } else { return $this->___callPlugins('getImage', func_get_args(), $pluginInfo); } }