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


PHP StoreManagerInterface::expects方法代码示例

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


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

示例1: testSetNotIntStoreId

 public function testSetNotIntStoreId()
 {
     $this->_storeManagerInterface->expects($this->once())->method('getStore');
     $store = $this->_model->setStoreId('test');
     $storeId = $store->getStoreId();
     $this->assertEquals(0, $storeId);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:7,代码来源:FlatTest.php

示例2: testGetAllOptions

 /**
  * Test for getAllOptions method
  *
  * @param $cachedDataSrl
  * @param $cachedDataUnsrl
  *
  * @dataProvider testGetAllOptionsDataProvider
  */
 public function testGetAllOptions($cachedDataSrl, $cachedDataUnsrl)
 {
     $this->storeMock->expects($this->once())->method('getCode')->will($this->returnValue('store_code'));
     $this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($this->storeMock));
     $this->cacheConfig->expects($this->once())->method('load')->with($this->equalTo('COUNTRYOFMANUFACTURE_SELECT_STORE_store_code'))->will($this->returnValue($cachedDataSrl));
     $countryOfManufacture = $this->objectManagerHelper->getObject('Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Countryofmanufacture', ['storeManager' => $this->storeManagerMock, 'configCacheType' => $this->cacheConfig]);
     $this->assertEquals($cachedDataUnsrl, $countryOfManufacture->getAllOptions());
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:16,代码来源:CountryofmanufactureTest.php

示例3: testConvertWithStoreCode

 public function testConvertWithStoreCode()
 {
     $amount = 5.6;
     $storeCode = 2;
     $convertedAmount = 9.300000000000001;
     $currency = $this->getCurrentCurrencyMock();
     $baseCurrency = $this->getBaseCurrencyMock($amount, $convertedAmount, $currency);
     $store = $this->getStoreMock($baseCurrency);
     $this->storeManager->expects($this->once())->method('getStore')->with($storeCode)->will($this->returnValue($store));
     $this->assertEquals($convertedAmount, $this->priceCurrency->convert($amount, $storeCode, $currency));
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:11,代码来源:PriceCurrencyTest.php

示例4: testCalculateTax

 /**
  * @param array $quoteDetailsData
  * @param array $taxDetailsData
  * @param string $calculateCallback Name of a function within this test class which will be executed to create
  *      a tax details item.
  * @return void
  * @dataProvider calculateTaxProvider
  */
 public function testCalculateTax($quoteDetailsData, $taxDetailsData, $calculateCallback = 'createTaxDetailsItem')
 {
     $storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
     $calculatorMock = $this->getMockBuilder('\\Magento\\Tax\\Model\\Calculation\\AbstractCalculator')->disableOriginalConstructor()->setMethods(['calculate'])->getMockForAbstractClass();
     $this->calculatorFactory->expects($this->any())->method('create')->will($this->returnValue($calculatorMock));
     $calculatorMock->expects($this->any())->method('calculate')->will($this->returnCallback([$this, $calculateCallback]));
     $quoteDetails = $this->quoteDetailsBuilder->populateWithArray($quoteDetailsData)->create();
     $taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
     $this->assertEquals($taxDetailsData, $taxDetails->__toArray());
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:19,代码来源:TaxCalculationServiceTest.php

示例5: testBeforeSave

 public function testBeforeSave()
 {
     $websiteId = 1;
     $object = $this->getMockBuilder('Magento\\Framework\\Object')->disableOriginalConstructor()->setMethods(array('hasData', 'setData'))->getMock();
     $store = $this->getMockBuilder('Magento\\Framework\\Object')->setMethods(array('getWebsiteId'))->getMock();
     $store->expects($this->once())->method('getWebsiteId')->will($this->returnValue($websiteId));
     $this->storeManager->expects($this->once())->method('getStore')->will($this->returnValue($store));
     $object->expects($this->once())->method('hasData')->with('website_id')->will($this->returnValue(false));
     $object->expects($this->once())->method('setData')->with($this->logicalOr('website_id', $websiteId))->will($this->returnSelf());
     /** @var \Magento\Framework\Object $object */
     $this->assertInstanceOf('Magento\\Customer\\Model\\Customer\\Attribute\\Backend\\Website', $this->testable->beforeSave($object));
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:12,代码来源:WebsiteTest.php

示例6: testGetCollection

 public function testGetCollection()
 {
     $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue(new \Magento\Framework\Object(array('id' => 42))));
     $this->currentCustomer->expects($this->any())->method('getCustomerId')->will($this->returnValue(4242));
     $this->collection->expects($this->any())->method('addStoreFilter')->with(42)->will($this->returnValue($this->collection));
     $this->collection->expects($this->any())->method('addCustomerFilter')->with(4242)->will($this->returnValue($this->collection));
     $this->collection->expects($this->any())->method('setDateOrder')->with()->will($this->returnValue($this->collection));
     $this->collection->expects($this->any())->method('setPageSize')->with(5)->will($this->returnValue($this->collection));
     $this->collection->expects($this->any())->method('load')->with()->will($this->returnValue($this->collection));
     $this->collection->expects($this->any())->method('addReviewSummary')->with()->will($this->returnValue($this->collection));
     $this->assertSame($this->collection, $this->object->getCollection());
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:12,代码来源:RecentTest.php

示例7: setUp

 protected function setUp()
 {
     $this->_storeManagerMock = $this->getMockBuilder('Magento\\Store\\Model\\StoreManager')->disableOriginalConstructor()->getMock();
     $this->_storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $this->_areaListMock = $this->getMock('Magento\\Framework\\App\\AreaList', array(), array(), '', false);
     $this->_configScopeMock = $this->getMock('Magento\\Framework\\Config\\ScopeInterface');
     $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->_storeMock));
     $this->_requestMock = $this->getMockBuilder('Magento\\Webapi\\Controller\\Soap\\Request')->disableOriginalConstructor()->getMock();
     $this->_domDocumentFactory = $this->getMockBuilder('Magento\\Framework\\DomDocument\\Factory')->disableOriginalConstructor()->getMock();
     $this->_soapServerFactory = $this->getMockBuilder('Magento\\Webapi\\Model\\Soap\\Server\\Factory')->disableOriginalConstructor()->getMock();
     $this->_typeProcessor = $this->getMock('Magento\\Webapi\\Model\\Config\\ClassReflector\\TypeProcessor', array(), array(), '', false);
     $this->_configMock = $this->getMock('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     parent::setUp();
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:14,代码来源:ServerTest.php

示例8: setUp

 protected function setUp()
 {
     $this->entityFactoryMock = $this->getMock('Magento\\Core\\Model\\EntityFactory', [], [], '', false);
     $this->loggerMock = $this->getMock('Magento\\Framework\\Logger', [], [], '', false);
     $this->fetchStrategyMock = $this->getMock('Magento\\Framework\\Data\\Collection\\Db\\FetchStrategyInterface');
     $this->managerInterfaceMock = $this->getMock('Magento\\Framework\\Event\\ManagerInterface');
     $this->configMock = $this->getMock('Magento\\Eav\\Model\\Config', [], [], '', false);
     $this->resourceMock = $this->getMock('Magento\\Framework\\App\\Resource', [], [], '', false);
     $this->entityFactoryMock2 = $this->getMock('Magento\\Eav\\Model\\EntityFactory');
     $this->helperMock = $this->getMock('Magento\\Catalog\\Model\\Resource\\Helper', [], [], '', false);
     $entity = $this->getMock('Magento\\Eav\\Model\\Entity\\AbstractEntity', [], [], '', false);
     $adapter = $this->getMockForAbstractClass('Zend_Db_Adapter_Abstract', [], '', false);
     $entity->expects($this->any())->method('getReadConnection')->will($this->returnValue($adapter));
     $entity->expects($this->any())->method('getDefaultAttributes')->will($this->returnValue([]));
     $this->universalFactoryMock = $this->getMock('Magento\\Framework\\Validator\\UniversalFactory', [], [], '', false);
     $this->universalFactoryMock->expects($this->any())->method('create')->will($this->returnValue($entity));
     $this->storeManagerMock = $this->getMockForAbstractClass('Magento\\Framework\\StoreManagerInterface');
     $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnCallback(function ($store) {
         return is_object($store) ? $store : new \Magento\Framework\Object(array('id' => 42));
     }));
     $this->catalogHelperMock = $this->getMock('Magento\\Catalog\\Helper\\Data', [], [], '', false);
     $this->stateMock = $this->getMock('Magento\\Catalog\\Model\\Indexer\\Product\\Flat\\State', [], [], '', false);
     $this->scopeConfigInterfaceMock = $this->getMock('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $this->optionFactoryMock = $this->getMock('Magento\\Catalog\\Model\\Product\\OptionFactory');
     $this->urlMock = $this->getMock('Magento\\Catalog\\Model\\Resource\\Url', [], [], '', false);
     $this->timezoneInterfaceMock = $this->getMock('Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface');
     $this->sessionMock = $this->getMock('Magento\\Customer\\Model\\Session', [], [], '', false);
     $this->dateTimeMock = $this->getMock('Magento\\Framework\\Stdlib\\DateTime');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->collection = $this->objectManagerHelper->getObject('Magento\\Catalog\\Model\\Resource\\Product\\Link\\Product\\Collection', ['entityFactory' => $this->entityFactoryMock, 'logger' => $this->loggerMock, 'fetchStrategy' => $this->fetchStrategyMock, 'eventManager' => $this->managerInterfaceMock, 'eavConfig' => $this->configMock, 'resource' => $this->resourceMock, 'eavEntityFactory' => $this->entityFactoryMock2, 'resourceHelper' => $this->helperMock, 'universalFactory' => $this->universalFactoryMock, 'storeManager' => $this->storeManagerMock, 'catalogData' => $this->catalogHelperMock, 'catalogProductFlatState' => $this->stateMock, 'scopeConfig' => $this->scopeConfigInterfaceMock, 'productOptionFactory' => $this->optionFactoryMock, 'catalogUrl' => $this->urlMock, 'localeDate' => $this->timezoneInterfaceMock, 'customerSession' => $this->sessionMock, 'dateTime' => $this->dateTimeMock]);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:31,代码来源:CollectionTest.php

示例9: testPrepareJsonAttributes

 public function testPrepareJsonAttributes()
 {
     $options = [];
     $attributeId = 1;
     $attributeCode = 'test_attribute';
     $attributeLabel = 'Test';
     $pricingValue = 100;
     $amount = 120;
     $modifiedValue = 140;
     $valueIndex = 2;
     $optionId = 1;
     $expected = ['priceOptions' => [$attributeId => ['id' => $attributeId, 'code' => $attributeCode, 'label' => $attributeLabel, 'options' => [0 => ['id' => $valueIndex, 'label' => $attributeLabel, 'price' => $modifiedValue, 'oldPrice' => $modifiedValue, 'inclTaxPrice' => $modifiedValue, 'exclTaxPrice' => $pricingValue, 'products' => []]]]], 'defaultValues' => [$attributeId => $optionId]];
     $attributePrices = [['is_percent' => false, 'pricing_value' => $pricingValue, 'value_index' => $valueIndex, 'label' => $attributeLabel]];
     $configurableAttributes = [$this->getAttributeMock($attributeId, $attributeCode, $attributeLabel, $attributePrices)];
     $configuredValueMock = $this->getMockBuilder('Magento\\Framework\\Object')->disableOriginalConstructor()->getMock();
     $configuredValueMock->expects($this->any())->method('getData')->will($this->returnValue($optionId));
     $configurableProduct = $this->getMockBuilder('Magento\\ConfigurableProduct\\Model\\Product\\Type\\Configurable')->disableOriginalConstructor()->getMock();
     $configurableProduct->expects($this->once())->method('getConfigurableAttributes')->with($this->equalTo($this->saleableItemMock))->will($this->returnValue($configurableAttributes));
     $this->saleableItemMock->expects($this->once())->method('getTypeInstance')->will($this->returnValue($configurableProduct));
     $this->saleableItemMock->expects($this->any())->method('setParentId');
     $this->saleableItemMock->expects($this->any())->method('hasPreconfiguredValues')->will($this->returnValue(true));
     $this->saleableItemMock->expects($this->any())->method('getPreconfiguredValues')->will($this->returnValue($configuredValueMock));
     $this->priceModifier->expects($this->once())->method('modifyPrice')->with($this->equalTo($pricingValue), $this->equalTo($this->saleableItemMock))->will($this->returnValue($amount));
     $this->calculatorMock->expects($this->any())->method('getAmount')->will($this->returnValue($this->getModifiedAmountMock($modifiedValue, $pricingValue)));
     $storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $this->priceCurrency->expects($this->once())->method('convert')->with($this->equalTo($modifiedValue))->will($this->returnArgument(0));
     $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
     $result = $this->attribute->prepareAttributes($options);
     $this->assertEquals($expected, $result);
 }
开发者ID:zhangjiachao,项目名称:magento2,代码行数:30,代码来源:AttributePriceTest.php

示例10: setUp

 protected function setUp()
 {
     $helper = new ObjectManager($this);
     $this->category = $this->getMockBuilder('Magento\\Catalog\\Model\\Category')->setMethods(['load', 'getId', '__wakeup'])->disableOriginalConstructor()->getMock();
     $this->categoryFactory = $this->getMockBuilder('Magento\\Catalog\\Model\\CategoryFactory')->setMethods(['create'])->disableOriginalConstructor()->getMock();
     $this->categoryFactory->expects($this->any())->method('create')->will($this->returnValue($this->category));
     $this->registry = $this->getMockBuilder('Magento\\Framework\\Registry')->setMethods(['registry'])->disableOriginalConstructor()->getMock();
     $this->store = $this->getMockBuilder('Magento\\Store\\Model\\Store')->setMethods(['getRootCategoryId', 'getFilters', '__wakeup'])->disableOriginalConstructor()->getMockForAbstractClass();
     $this->storeManager = $this->getMockBuilder('Magento\\Framework\\StoreManagerInterface')->setMethods(['getStore'])->disableOriginalConstructor()->getMockForAbstractClass();
     $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
     $this->stateKeyGenerator = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\Category\\StateKey')->setMethods(['toString'])->disableOriginalConstructor()->getMock();
     $this->collectionFilter = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\Category\\CollectionFilter')->setMethods(['filter'])->disableOriginalConstructor()->getMock();
     $this->collectionProvider = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\ItemCollectionProviderInterface')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->filter = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\Filter\\Item')->setMethods(['getFilter', 'getValueString'])->disableOriginalConstructor()->getMock();
     $this->abstractFilter = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\Filter\\AbstractFilter')->setMethods(['getRequestVar'])->disableOriginalConstructor()->getMock();
     $this->context = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\ContextInterface')->setMethods(['getStateKey', 'getCollectionFilter'])->disableOriginalConstructor()->getMockForAbstractClass();
     $this->context->expects($this->any())->method('getStateKey')->will($this->returnValue($this->stateKeyGenerator));
     $this->context->expects($this->any())->method('getCollectionFilter')->will($this->returnValue($this->collectionFilter));
     $this->context->expects($this->any())->method('getCollectionProvider')->will($this->returnValue($this->collectionProvider));
     $this->state = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\State')->disableOriginalConstructor()->getMock();
     $this->stateFactory = $this->getMockBuilder('Magento\\Catalog\\Model\\Layer\\StateFactory')->setMethods(['create'])->disableOriginalConstructor()->getMock();
     $this->stateFactory->expects($this->any())->method('create')->will($this->returnValue($this->state));
     $this->collection = $this->getMockBuilder('Magento\\Catalog\\Model\\Resource\\Product\\Collection')->disableOriginalConstructor()->getMock();
     $this->model = $helper->getObject('Magento\\Catalog\\Model\\Layer', ['registry' => $this->registry, 'categoryFactory' => $this->categoryFactory, 'storeManager' => $this->storeManager, 'context' => $this->context, 'layerStateFactory' => $this->stateFactory]);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:25,代码来源:LayerTest.php

示例11: setUp

 public function setUp()
 {
     $this->request = $this->getMock('Magento\\Framework\\App\\RequestInterface');
     $this->response = $this->getMock('Magento\\Framework\\App\\ResponseInterface');
     $this->categoryHelper = $this->getMock('Magento\\Catalog\\Helper\\Category', [], [], '', false);
     $this->objectManager = $this->getMock('Magento\\Framework\\ObjectManager', [], [], '', false);
     $this->eventManager = $this->getMock('Magento\\Framework\\Event\\ManagerInterface');
     $this->update = $this->getMock('Magento\\Framework\\View\\Layout\\ProcessorInterface');
     $this->layout = $this->getMock('Magento\\Framework\\View\\Layout', [], [], '', false);
     $this->layout->expects($this->any())->method('getUpdate')->will($this->returnValue($this->update));
     $this->pageConfig = $this->getMockBuilder('Magento\\Framework\\View\\Page\\Config')->disableOriginalConstructor()->getMock();
     $this->pageConfig->expects($this->any())->method('addBodyClass')->will($this->returnSelf());
     $this->page = $this->getMockBuilder('Magento\\Framework\\View\\Page')->setMethods(['getConfig', 'initLayout'])->disableOriginalConstructor()->getMock();
     $this->page->expects($this->any())->method('getConfig')->will($this->returnValue($this->pageConfig));
     $this->view = $this->getMock('Magento\\Framework\\App\\ViewInterface');
     $this->view->expects($this->any())->method('getLayout')->will($this->returnValue($this->layout));
     $this->view->expects($this->any())->method('getPage')->will($this->returnValue($this->page));
     $this->context = $this->getMock('Magento\\Backend\\App\\Action\\Context', [], [], '', false);
     $this->context->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
     $this->context->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));
     $this->context->expects($this->any())->method('getObjectManager')->will($this->returnValue($this->objectManager));
     $this->context->expects($this->any())->method('getEventManager')->will($this->returnValue($this->eventManager));
     $this->context->expects($this->any())->method('getView')->will($this->returnValue($this->view));
     $this->category = $this->getMock('Magento\\Catalog\\Model\\Category', [], [], '', false);
     $this->categoryFactory = $this->getMock('Magento\\Catalog\\Model\\CategoryFactory', ['create'], [], '', false);
     $this->store = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false);
     $this->storeManager = $this->getMock('Magento\\Framework\\StoreManagerInterface');
     $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($this->store));
     $this->catalogDesign = $this->getMock('Magento\\Catalog\\Model\\Design', [], [], '', false);
     $this->layoutHelper = $this->getMock('Magento\\Theme\\Helper\\Layout', [], [], '', false);
     $this->action = (new ObjectManager($this))->getObject('Magento\\Catalog\\Controller\\Category\\View', ['context' => $this->context, 'catalogDesign' => $this->catalogDesign, 'categoryFactory' => $this->categoryFactory, 'storeManager' => $this->storeManager]);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:32,代码来源:ViewTest.php

示例12: testIsThemeAssignedToDefaultStore

 /**
  * @covers \Magento\Theme\Model\Config\Customization::isThemeAssignedToStore
  */
 public function testIsThemeAssignedToDefaultStore()
 {
     $this->_storeManager->expects($this->once())->method('getStores')->will($this->returnValue(array($this->_getStore())));
     $this->_designPackage->expects($this->once())->method('getConfigurationDesignTheme')->will($this->returnValue($this->_getAssignedTheme()->getId()));
     $this->themeProviderMock->expects($this->once())->method('getThemeCustomizations')->with(\Magento\Framework\App\Area::AREA_FRONTEND)->will($this->returnValue(array($this->_getAssignedTheme(), $this->_getUnassignedTheme())));
     $themeAssigned = $this->_model->isThemeAssignedToStore($this->_getAssignedTheme());
     $this->assertEquals(true, $themeAssigned);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:11,代码来源:CustomizationTest.php

示例13: testAddReviewItemXmlCallback

 public function testAddReviewItemXmlCallback()
 {
     $row = ['entity_id' => 1, 'store_id' => 2, 'review_id' => 3, 'name' => 'Product Name', 'title' => 'Review Summary', 'detail' => 'Test of a review', 'nickname' => 'User Name'];
     $productUrl = 'http://product.url';
     $reviewUrl = 'http://review.url';
     $reviewModel = $this->getMock('Magento\\Review\\Model\\Review', [], [], '', false);
     $reviewModel->expects($this->once())->method('getProductUrl')->with($this->equalTo($row['entity_id']), $this->equalTo($row['store_id']))->will($this->returnValue($productUrl));
     $this->urlInterfaceMock->expects($this->once())->method('getUrl')->with($this->equalTo('review/product/edit/'), $this->equalTo(array('id' => $row['review_id'], '_secure' => true, '_nosecret' => true)))->will($this->returnValue($reviewUrl));
     $storeName = 'Store Name';
     $this->storeManagerMock->expects($this->once())->method('getStore')->with($this->equalTo($row['store_id']))->will($this->returnSelf());
     $this->storeManagerMock->expects($this->once())->method('getName')->will($this->returnValue($storeName));
     $rssObj = $this->getMock('Magento\\Rss\\Model\\Rss', [], [], '', false);
     $description = '<p>' . __('Product: <a href="%1" target="_blank">%2</a> <br/>', $productUrl, $row['name']) . __('Summary of review: %1 <br/>', $row['title']) . __('Review: %1 <br/>', $row['detail']) . __('Store: %1 <br/>', $storeName) . __('Click <a href="%1">here</a> to view the review.', $reviewUrl) . '</p>';
     $rssObj->expects($this->once())->method('_addEntry')->with($this->equalTo(['title' => __('Product: "%1" reviewed by: %2', $row['name'], $row['nickname']), 'link' => 'test', 'description' => $description]))->will($this->returnSelf());
     $args = ['row' => $row, 'reviewModel' => $reviewModel, 'rssObj' => $rssObj];
     $this->assertNull($this->review->addReviewItemXmlCallback($args));
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:17,代码来源:ReviewTest.php

示例14: setUp

 protected function setUp()
 {
     $this->_consumerFactory = $this->getMockBuilder('Magento\\Integration\\Model\\Oauth\\Consumer\\Factory')->disableOriginalConstructor()->getMock();
     $this->_consumerMock = $this->getMockBuilder('Magento\\Integration\\Model\\Oauth\\Consumer')->disableOriginalConstructor()->getMock();
     $this->_consumerFactory->expects($this->any())->method('create')->will($this->returnValue($this->_consumerMock));
     $this->_tokenFactory = $this->getMockBuilder('Magento\\Integration\\Model\\Oauth\\Token\\Factory')->disableOriginalConstructor()->getMock();
     $this->_tokenMock = $this->getMockBuilder('Magento\\Integration\\Model\\Oauth\\Token')->disableOriginalConstructor()->getMock();
     $this->_tokenFactory->expects($this->any())->method('create')->will($this->returnValue($this->_tokenMock));
     $this->_storeManagerMock = $this->getMockBuilder('Magento\\Framework\\StoreManagerInterface')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->_storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->_storeMock));
     $this->_dataHelper = $this->getMockBuilder('Magento\\Integration\\Helper\\Oauth\\Data')->disableOriginalConstructor()->getMock();
     $oauthHelperMock = $this->getMockBuilder('Magento\\Framework\\Oauth\\Helper\\Oauth')->disableOriginalConstructor()->getMock();
     $tokenProviderMock = $this->getMockBuilder('Magento\\Integration\\Model\\Oauth\\Token\\Provider')->disableOriginalConstructor()->getMock();
     $this->_httpClientMock = $this->getMockBuilder('Magento\\Framework\\HTTP\\ZendClient')->disableOriginalConstructor()->getMock();
     $this->_loggerMock = $this->getMockBuilder('Magento\\Framework\\Logger')->disableOriginalConstructor()->setMethods(array('logException'))->getMock();
     $this->_oauthService = new \Magento\Integration\Service\V1\Oauth($this->_storeManagerMock, $this->_consumerFactory, $this->_tokenFactory, $this->_dataHelper, $this->_httpClientMock, $this->_loggerMock, $oauthHelperMock, $tokenProviderMock);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:18,代码来源:ConsumerTest.php

示例15: testIsAvailableOnStore

 /**
  * @param int|null $storeId
  * @param bool $result
  * @dataProvider isAvailableOnStoreDataProvider
  */
 public function testIsAvailableOnStore($storeId, $result)
 {
     $store = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false);
     if ($storeId) {
         $store->expects($this->once())->method('getId')->will($this->returnValue($storeId));
         $this->storeManagerMock->expects($this->once())->method('getStore')->with($this->equalTo($store))->will($this->returnValue($store));
     }
     $this->assertSame($result, $this->review->isAvailableOnStore($store));
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:14,代码来源:ReviewTest.php


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