public function testGetDefaultCurrencyReturnGroupDefaultCurrency() { $this->_requestMock->expects($this->any())->method('getParam')->will($this->returnValueMap(array(array('store', null, ''), array('website', null, ''), array('group', null, 'someGroup')))); $websiteMock = $this->getMock('Magento\\Store\\Model\\Website', array(), array(), '', false); $websiteMock->expects($this->once())->method('getBaseCurrencyCode')->will($this->returnValue('websiteCurrency')); $groupMock = $this->getMock('Magento\\Store\\Model\\Group', array(), array(), '', false); $groupMock->expects($this->once())->method('getWebsite')->will($this->returnValue($websiteMock)); $this->_storeManagerMock->expects($this->once())->method('getGroup')->with('someGroup')->will($this->returnValue($groupMock)); $this->assertEquals('websiteCurrency', $this->_model->getDefaultCurrency($this->_requestMock)); }
/** * Returns currency code, false on error * * @param \Magento\Framework\Object $row * @return string */ protected function _getCurrencyCode($row) { if ($code = $this->getColumn()->getCurrencyCode()) { return $code; } if ($code = $row->getData($this->getColumn()->getCurrency())) { return $code; } return $this->_currencyLocator->getDefaultCurrency($this->_request); }
/** * Retrieve column currency code * * @return string */ protected function _getColumnCurrencyCode() { return $this->getColumn()->getCurrencyCode() ? $this->getColumn()->getCurrencyCode() : $this->_currencyLocator->getDefaultCurrency($this->_request); }