本文整理汇总了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([]));
}
示例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];
}
示例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));
}
示例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();
}
示例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])]);
}
示例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([]));
}