当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Store::expects方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Store::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Store::expects方法的具体用法?PHP Mage_Core_Model_Store::expects怎么用?PHP Mage_Core_Model_Store::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Store的用法示例。


在下文中一共展示了Mage_Core_Model_Store::expects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testConstructDisableWsdlCache

 /**
  * Test Soap server construction with WSDL cache disabling.
  */
 public function testConstructDisableWsdlCache()
 {
     /** Mock getConfig method to return false. */
     $this->_storeMock->expects($this->any())->method('getConfig')->will($this->returnValue(false));
     /** Create Soap server object. */
     $server = new Mage_Webapi_Model_Soap_Server($this->_applicationMock, $this->_requestMock, $this->_domDocumentFactory);
     $server->initWsdlCache();
     /** Assert soap wsdl caching option was disabled after soap server initialization. */
     $this->assertFalse((bool) ini_get('soap.wsdl_cache_enabled'), 'WSDL caching was not disabled.');
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例2: testGetEndpointUri

 /**
  * Test getEndpointUri method.
  */
 public function testGetEndpointUri()
 {
     $this->_storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue('http://magento.com/'));
     $expectedResult = 'http://magento.com/' . Mage_Webapi_Controller_Router_Route_Webapi::API_AREA_NAME . '/' . Mage_Webapi_Controller_Front::API_TYPE_SOAP;
     $actualResult = $this->_soapServer->getEndpointUri();
     $this->assertEquals($expectedResult, $actualResult, 'Wrong endpoint URI building.');
 }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例3: setUp

 public function setUp()
 {
     $this->_realCoreHelper = Mage::helper('eb2ccore');
     $this->_doc = $this->_realCoreHelper->getNewDomDocument();
     $this->_coreHelper = $this->getHelperMock('eb2ccore/data', array('getConfigModel', 'triggerError', 'parseBool', 'getNewDomDocument'));
     $this->_docMock = $this->getMockBuilder('EbayEnterprise_Dom_Document')->disableOriginalConstructor()->setMethods(array('save', 'loadXML', 'importNode'))->getMock();
     $this->_pimProductCollection = $this->getModelMockBuilder('ebayenterprise_catalog/pim_product_collection')->disableOriginalConstructor()->setMethods(array('count', 'getItems'))->getMock();
     $this->_feedTypeConfig = $this->_stubFeedConfig();
     $this->_productIdCollection = new Varien_Data_Collection();
     $this->_productIdCollection->addItem(new Varien_Object(array('id' => 1, 'entity_id' => 1)));
     $this->_emptyBatch = Mage::getModel('ebayenterprise_catalog/pim_batch');
     $batchClass = 'EbayEnterprise_Catalog_Model_Pim_Batch';
     $this->_defaultStore = $this->getModelMockBuilder('core/store')->disableOriginalConstructor()->setMethods(array('getId'))->getMock();
     $this->_defaultStore->expects($this->any())->method('getId')->will($this->returnValue(0));
     $this->_store = $this->getModelMockBuilder('core/store')->disableOriginalConstructor()->setMethods(array('getId'))->getMock();
     $this->_store->expects($this->any())->method('getId')->will($this->returnValue(1));
     $this->_storesArray = array(0 => $this->_defaultStore, 1 => $this->_store);
     $this->_batch = Mage::getModel('ebayenterprise_catalog/pim_batch', array($batchClass::COLLECTION_KEY => $this->_productIdCollection, $batchClass::STORES_KEY => array(1 => $this->_store), $batchClass::FT_CONFIG_KEY => $this->_feedTypeConfig, $batchClass::DEFAULT_STORE_KEY => $this->_defaultStore));
     $this->_coreFeed = $this->getModelMockBuilder('ebayenterprise_catalog/feed_core')->disableOriginalConstructor()->setMethods(array('getLocalDirectory'))->getMock();
     $this->_prodHelper = $this->getHelperMockBuilder('ebayenterprise_catalog/data')->disableOriginalConstructor()->setMethods(array('generateFileName'))->getMock();
     // suppressing the real session from starting
     $session = $this->getModelMockBuilder('core/session')->disableOriginalConstructor()->setMethods(null)->getMock();
     $this->replaceByMock('singleton', 'core/session', $session);
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:24,代码来源:PimTest.php

示例4: testGetCurrentUrl

 public function testGetCurrentUrl()
 {
     $this->_model->expects($this->any())->method('getUrl')->will($this->returnValue('http://localhost/index.php'));
     $this->assertStringEndsWith('default', $this->_model->getCurrentUrl());
     $this->assertStringEndsNotWith('default', $this->_model->getCurrentUrl(false));
 }
开发者ID:relue,项目名称:magento2,代码行数:6,代码来源:StoreTest.php


注:本文中的Mage_Core_Model_Store::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。