コード例 #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);
 }