Exemplo n.º 1
0
 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('Mage_Core_Model_Website', array(), array(), '', false);
     $websiteMock->expects($this->once())->method('getBaseCurrencyCode')->will($this->returnValue('websiteCurrency'));
     $groupMock = $this->getMock('Mage_Core_Model_Store_Group', array(), array(), '', false);
     $groupMock->expects($this->once())->method('getWebsite')->will($this->returnValue($websiteMock));
     $this->_appMock->expects($this->once())->method('getGroup')->with('someGroup')->will($this->returnValue($groupMock));
     $this->assertEquals('websiteCurrency', $this->_model->getDefaultCurrency($this->_requestMock));
 }
Exemplo n.º 2
0
 /**
  * Returns currency code, false on error
  *
  * @param $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);
 }