public function testGetStore() { $storeId = 1; $storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock(); $this->storeManagerMock->expects($this->once())->method('getStore')->with($storeId)->will($this->returnValue($storeMock)); $this->quote->setStoreId($storeId); $result = $this->quote->getStore(); $this->assertInstanceOf('Magento\\Store\\Model\\Store', $result); }
/** * Check whether payment method is applicable to quote * Purposed to allow use in controllers some logic that was implemented in blocks only before * * @param PaymentMethodChecksInterface $paymentMethod * @param \Magento\Sales\Model\Quote $quote * @return bool */ public function isApplicable(PaymentMethodChecksInterface $paymentMethod, Quote $quote) { return $paymentMethod->canUseForCurrency($quote->getStore()->getBaseCurrencyCode()); }
/** * Format price base on store convert price method * * @param float $price * @return string */ protected function _formatPrice($price) { return $this->priceCurrency->convertAndFormat($price, true, PriceCurrencyInterface::DEFAULT_PRECISION, $this->_quote->getStore()); }
/** * Format price base on store convert price method * * @param float $price * @return string */ protected function _formatPrice($price) { return $this->_quote->getStore()->convertPrice($price, true); }