/** * Test for method getDisplayAmountExclTax */ public function testGetDisplayAmountExclTax() { $expectedPriceValue = 1.23; $expectedPrice = '$4.56'; /** @var \Magento\Framework\Pricing\Render\Amount $amountRender */ $amountRender = $this->getMockBuilder('Magento\\Framework\\Pricing\\Render\\Amount')->disableOriginalConstructor()->setMethods(['getAmount'])->getMock(); /** @var \Magento\Framework\Pricing\Amount\Base $baseAmount */ $baseAmount = $this->getMockBuilder('Magento\\Framework\\Pricing\\Amount\\Base')->disableOriginalConstructor()->setMethods(['getValue'])->getMock(); $baseAmount->expects($this->any())->method('getValue')->will($this->returnValue($expectedPriceValue)); $amountRender->expects($this->any())->method('getAmount')->will($this->returnValue($baseAmount)); $this->priceCurrencyMock->expects($this->any())->method('format')->will($this->returnValue($expectedPrice)); $this->model->render($amountRender); $result = $this->model->getDisplayAmountExclTax(); $this->assertEquals($expectedPrice, $result); }