/** * @covers \Magento\Checkout\Block\Cart\Item\Renderer::getProductPriceHtml * @covers \Magento\Checkout\Block\Cart\Item\Renderer::getPriceRender */ public function testGetProductPriceHtml() { $priceHtml = 'some price html'; $product = $this->getMockBuilder('Magento\\Catalog\\Model\\Product')->disableOriginalConstructor()->getMock(); $priceRender = $this->getMockBuilder('Magento\\Framework\\Pricing\\Render')->disableOriginalConstructor()->getMock(); $this->layout->expects($this->atLeastOnce())->method('getBlock')->with('product.price.render.default')->will($this->returnValue($priceRender)); $priceRender->expects($this->once())->method('render')->with(\Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, $product, ['include_container' => true, 'display_minimal_price' => true, 'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST])->will($this->returnValue($priceHtml)); $this->assertEquals($priceHtml, $this->_renderer->getProductPriceHtml($product)); }