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


PHP EbayEnterprise_MageLog_Helper_Context::expects方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->getHelperMockBuilder('ebayenterprise_magelog/data')->disableOriginalConstructor()->getMock();
     $this->logContext = $this->getHelperMockBuilder('ebayenterprise_magelog/context')->disableOriginalConstructor()->getMock();
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:7,代码来源:AllocationTest.php

示例2: setUp

 public function setUp()
 {
     $this->helper = $this->getHelperMock('ebayenterprise_giftcard/data', ['__', 'getConfigData']);
     $this->coreHelper = $this->getHelperMock('eb2ccore/data', ['getSdkApi']);
     $this->logger = $this->getHelperMock('ebayenterprise_magelog/data');
     $this->logContext = $this->getHelperMock('ebayenterprise_magelog/context');
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
     $this->apiLogger = $this->getMock('\\Psr\\Log\\NullLogger');
     $this->config = $this->buildCoreConfigRegistry(['apiService' => 'payments', 'apiOperationTenderTypeLookup' => 'tendertype/lookup']);
     $this->constructorArgs = ['core_helper' => $this->coreHelper, 'helper' => $this->helper, 'logger' => $this->logger, 'log_context' => $this->logContext, 'api_logger' => $this->apiLogger, 'config' => $this->config];
 }
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:11,代码来源:TendertypeTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->getHelperMockBuilder('ebayenterprise_magelog/data')->disableOriginalConstructor()->getMock();
     $this->logContext = $this->getHelperMockBuilder('ebayenterprise_magelog/context')->disableOriginalConstructor()->getMock();
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
     $this->request = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IAllocationRollbackRequest');
     $this->reply = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IAllocationRollbackReply');
     $this->httpApi = $this->getMockBuilder('\\eBayEnterprise\\RetailOrderManagement\\Api\\IBidirectionalApi')->disableOriginalConstructor()->setMethods(['send', 'getRequestBody', 'getResponseBody', 'setRequestBody'])->getMock();
     $this->httpApi->expects($this->any())->method('setRequestBody')->with($this->isInstanceOf('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IAllocationRollbackRequest'))->will($this->returnSelf());
     $this->httpApi->expects($this->any())->method('getRequestBody')->will($this->returnValue($this->request));
     $this->httpApi->expects($this->any())->method('getResponseBody')->will($this->returnValue($this->reply));
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:13,代码来源:ServiceTest.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->getHelperMockBuilder('ebayenterprise_magelog/data')->disableOriginalConstructor()->getMock();
     $this->logContext = $this->getHelperMockBuilder('ebayenterprise_magelog/context')->disableOriginalConstructor()->getMock();
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
     // mock the item iterable to create and store
     // item payloads
     $this->itemIterable = $this->getMockBuilder('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IItemIterable')->disableOriginalConstructor()->setMethods(['attach', 'getEmptyShippingItem', 'getEmptyInStorePickUpItem'])->getMockForAbstractClass();
     // mock the request to return the iterable mock
     $this->request = $this->getMockBuilder('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IInventoryDetailsRequest')->disableOriginalConstructor()->setMethods(['getItems'])->getMockForAbstractClass();
     $this->request->expects($this->any())->method('getItems')->will($this->returnValue($this->itemIterable));
     // avoid having to mock the item helper's dependencies
     $this->itemHelper = $this->getHelperMock('ebayenterprise_inventory/details_item', ['fillOutShippingItem']);
     // prevent magento events from actually triggering
     Mage::app()->disableEvents();
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:17,代码来源:BuilderTest.php

示例5: setUp

 public function setUp()
 {
     // Create a mock of the quantity results for the quote.
     $this->_quantityResults = $this->getModelMockBuilder('ebayenterprise_inventory/quantity_results')->disableOriginalConstructor()->setMethods(['getQuantityBySku', 'getQuantityByItemId'])->getMock();
     // Create a quote object to use within tests. Expected by
     // default by the quantity collector when getting results for a quote.
     $this->_quote = $this->getModelMock('sales/quote', ['addErrorInfo', 'getAllItems']);
     // Mock the quantity collector to simply always return
     // the mocked quantity results throughout the tests.
     $this->_quantityCollector = $this->getModelMockBuilder('ebayenterprise_inventory/quantity_collector')->disableOriginalConstructor()->setMethods(['getQuantityResultsForQuote', 'clearResults'])->getMock();
     $this->_quantityCollector->expects($this->any())->method('getQuantityResultsForQuote')->with($this->identicalTo($this->_quote))->will($this->returnValue($this->_quantityResults));
     // Mock of the item selection helper, used to filter
     // down quote items down to just the items that need
     // to be checked by the inventory service.
     $this->_inventoryItemSelection = $this->getHelperMock('ebayenterprise_inventory/item_selection', ['selectFrom']);
     // Mock the inventory's data helper to control
     // expected results from translations doing translations.
     $this->_inventoryHelper = $this->getHelperMock('ebayenterprise_inventory/data', ['__', 'getRomSku']);
     // Mock out the translate method, while it would be nice to ensure
     // strings are getting translated through this method, the complexity
     // of doing so is not currently worth the effort.
     $this->_inventoryHelper->expects($this->any())->method('__')->will($this->returnArgument(0));
     // Mock the SKU normalization method to just always return the given
     // SKU. Prevents the need for ensuring configuration is set up just so
     // for given SKUs to match the "normalized" SKU.
     $this->_inventoryHelper->expects($this->any())->method('getRomSku')->will($this->returnArgument(0));
     // Mock calculations of total item quantity.
     $this->_quantityHelper = $this->getHelperMock('ebayenterprise_inventory/quantity', ['calculateTotalQuantityRequested']);
     /** @var EbayEnterprise_MageLog_Helper_Context */
     $this->_context = $this->getHelperMock('ebayenterprise_magelog/context', ['getMetaData']);
     $this->_context->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
     // Instance of the model being tested, injected
     // with the mocked dependencies.
     $this->_quantityService = Mage::getModel('ebayenterprise_inventory/quantity_service', ['quantity_collector' => $this->_quantityCollector, 'inventory_item_selection' => $this->_inventoryItemSelection, 'inventory_helper' => $this->_inventoryHelper, 'quantity_helper' => $this->_quantityHelper, 'log_context' => $this->_context]);
     $this->_product = Mage::getModel('catalog/product', ['stock_item' => Mage::getModel('catalogInventory/stock_item', ['backorders' => Mage_CatalogInventory_Model_Stock::BACKORDERS_NO])]);
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:36,代码来源:ServiceTest.php

示例6: setUp

 public function setUp()
 {
     $this->logger = $this->getHelperMock('ebayenterprise_magelog/data', ['warning']);
     $this->context = $this->getHelperMock('ebayenterprise_magelog/context', ['getMetaData']);
     $this->context->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:6,代码来源:ResponseTest.php


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