コード例 #1
0
 public function testConvertAndFormat()
 {
     $amount = 5.6;
     $precision = \Magento\Framework\Pricing\PriceCurrencyInterface::DEFAULT_PRECISION;
     $includeContainer = false;
     $store = null;
     $convertedAmount = 9.300000000000001;
     $formattedAmount = '9.3 grn';
     $currency = $this->getCurrentCurrencyMock();
     $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currency);
     $store = $this->getStoreMock($baseCurrency);
     $currency->expects($this->once())->method('formatPrecision')->with($convertedAmount, $precision, [], $includeContainer)->will($this->returnValue($formattedAmount));
     $this->assertEquals($formattedAmount, $this->priceCurrency->convertAndFormat($amount, $includeContainer, $precision, $store, $currency));
 }