/** * Test testGetProductPriceHtml */ public function testGetProductPriceHtml() { $expectedPriceHtml = '<html>Expected Price html with price $30</html>'; $priceRenderBlock = $this->getMock('Magento\\Framework\\Pricing\\Render', ['render'], [], '', false); $product = $this->getMock('Magento\\Catalog\\Model\\Product', [], [], '', false); $this->layoutMock->expects($this->once())->method('getBlock')->with('product.price.render.default')->will($this->returnValue($priceRenderBlock)); $priceRenderBlock->expects($this->once())->method('render')->will($this->returnValue($expectedPriceHtml)); $this->assertEquals($expectedPriceHtml, $this->block->getProductPriceHtml($product, 'price_code', 'zone_code')); }
/** * {@inheritdoc} */ public function getProductPriceHtml(\Magento\Catalog\Model\Product $product, $priceType, $renderZone = 'item_list', array $arguments = array()) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getProductPriceHtml'); if (!$pluginInfo) { return parent::getProductPriceHtml($product, $priceType, $renderZone, $arguments); } else { return $this->___callPlugins('getProductPriceHtml', func_get_args(), $pluginInfo); } }