コード例 #1
0
 public function setUp()
 {
     // disable the constructor to avoid having to mock the internals of the pim model.
     $this->_pimMock = $this->getModelMock('ebayenterprise_catalog/pim', array('buildFeed'));
     $this->_batch = $this->getModelMock('ebayenterprise_catalog/pim_batch');
     $this->_container = $this->getModelMock('ebayenterprise_catalog/pim_batch_container', array('getBatches'));
     $this->_priceCollector = $this->getModelMock('ebayenterprise_catalog/pim_collector_price');
     $this->_combinedCollector = $this->getModelMock('ebayenterprise_catalog/pim_collector_combined');
     $this->_configRegistry = $this->getModelMock('eb2ccore/config_registry', array('getConfigData', '__get'));
     $this->_configRegistry->expects($this->any())->method('getConfigData')->with($this->isType('string'))->will($this->returnValue($this->_feedConfig));
     $this->_configRegistry->expects($this->any())->method('__get')->will($this->returnValueMap(array(array('pimExportFeedCutoffDate', $this->_cutoffDate), array('exportFeedConfig', $this->_feedConfig))));
     // mock the product helper
     $this->_productHelper = $this->getHelperMock('ebayenterprise_catalog/data', array('getConfigModel'));
     $this->_productHelper->expects($this->any())->method('getConfigModel')->will($this->returnValue($this->_configRegistry));
     // suppressing the real session from starting
     $session = $this->getModelMockBuilder('core/session')->disableOriginalConstructor()->setMethods(null)->getMock();
     $this->replaceByMock('singleton', 'core/session', $session);
 }
コード例 #2
0
 /**
  * get the title from the carrier
  *
  * @param Mage_Shipping_Model_Carrier_Abstract
  * @return string
  */
 protected function getCarrierTitle(Mage_Shipping_Model_Carrier_Abstract $model)
 {
     // ensure consistent scope when we're querying config data
     return $model->setStore($this->config->getStore())->getConfigData('title');
 }
コード例 #3
0
 /**
  * Set the scope of the payment method to a mage store.
  *
  * @param mixed $storeId
  *
  * @return self
  */
 public function setStore($storeId = null)
 {
     $this->_config->setStore($storeId);
     return $this;
 }