Example #1
0
 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     $this->contextMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\Context')->disableOriginalConstructor()->setMethods(['getUrlBuilder'])->getMock();
     $this->urlBuilderMock = $this->getMockBuilder('Magento\\Framework\\UrlInterface')->disableOriginalConstructor()->getMock();
     $this->contextMock->expects($this->any())->method('getUrlBuilder')->willReturn($this->urlBuilderMock);
     $this->contactForm = new ContactForm($this->contextMock);
 }
Example #2
0
 protected function setUp()
 {
     $this->storeManager = $this->getMockBuilder('Magento\\Framework\\Store\\StoreManagerInterface')->getMock();
     $this->context = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', [], [], '', false);
     $this->context->expects($this->any())->method('getStoreManager')->will($this->returnValue($this->storeManager));
     $this->corePostDataHelper = $this->getMock('Magento\\Core\\Helper\\PostData', [], [], '', false);
     $this->switcher = (new ObjectManager($this))->getObject('Magento\\Store\\Block\\Switcher', ['context' => $this->context, 'postDataHelper' => $this->corePostDataHelper]);
 }
Example #3
0
 protected function setUp()
 {
     $this->contextMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\Context')->disableOriginalConstructor()->getMock();
     $this->sessionConfigMock = $this->getMockBuilder('Magento\\Framework\\Session\\Config')->disableOriginalConstructor()->getMock();
     $this->ipValidatorMock = $this->getMockBuilder('Magento\\Framework\\Validator\\Ip')->disableOriginalConstructor()->getMock();
     $validtorMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\File\\Validator')->setMethods(['isValid'])->disableOriginalConstructor()->getMock();
     $scopeConfigMock = $this->getMockBuilder('Magento\\Framework\\App\\Config')->setMethods(['isSetFlag'])->disableOriginalConstructor()->getMock();
     $this->contextMock->expects($this->any())->method('getScopeConfig')->will($this->returnValue($scopeConfigMock));
     $this->contextMock->expects($this->any())->method('getValidator')->will($this->returnValue($validtorMock));
     $this->model = new \Magento\Framework\View\Element\Js\Cookie($this->contextMock, $this->sessionConfigMock, $this->ipValidatorMock, []);
 }
 protected function setUp()
 {
     $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\Context')->disableOriginalConstructor()->setMethods(['getRequest'])->getMock();
     $this->request = $this->getMockBuilder('Magento\\Framework\\App\\RequestInterface')->getMockForAbstractClass();
     $this->context->expects($this->once())->method('getRequest')->willReturn($this->request);
     $this->productTypeList = $this->getMockBuilder('Magento\\Catalog\\Api\\ProductTypeListInterface')->getMockForAbstractClass();
     $this->productRepository = $this->getMockBuilder('Magento\\Catalog\\Api\\ProductRepositoryInterface')->getMockForAbstractClass();
     $this->searchCriteriaBuilder = $this->getMockBuilder('Magento\\Framework\\Api\\SearchCriteriaBuilder')->disableOriginalConstructor()->getMock();
     $this->filterBuilder = $this->getMockBuilder('Magento\\Framework\\Api\\FilterBuilder')->disableOriginalConstructor()->getMock();
     $this->block = $objectManager->getObject('Magento\\SampleServiceContractClient\\Block\\ProductList', ['context' => $this->context, 'productTypeList' => $this->productTypeList, 'productRepository' => $this->productRepository, 'searchCriteriaBuilder' => $this->searchCriteriaBuilder, 'filterBuilder' => $this->filterBuilder]);
 }
 protected function setUp()
 {
     $this->storeManager = $this->getMock('\\Magento\\Framework\\StoreManagerInterface');
     $this->context = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', array(), array(), '', false);
     $this->context->expects($this->any())->method('getStoreManager')->will($this->returnValue($this->storeManager));
     $this->collection = $this->getMock('Magento\\Review\\Model\\Resource\\Review\\Product\\Collection', array(), array(), '', false);
     $this->collectionFactory = $this->getMock('Magento\\Review\\Model\\Resource\\Review\\Product\\CollectionFactory', array('create'), array(), '', false);
     $this->collectionFactory->expects($this->once())->method('create')->will($this->returnValue($this->collection));
     $this->currentCustomer = $this->getMock('Magento\\Customer\\Helper\\Session\\CurrentCustomer', array(), array(), '', false);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->object = $this->objectManagerHelper->getObject('Magento\\Review\\Block\\Customer\\Recent', array('context' => $this->context, 'collectionFactory' => $this->collectionFactory, 'currentCustomer' => $this->currentCustomer));
 }
Example #6
0
 protected function setUp()
 {
     $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->context = $this->getMockBuilder('Magento\\Framework\\App\\Action\\Context')->disableOriginalConstructor()->setMethods(['getRequest', 'getResponse'])->getMock();
     $this->response = $this->getMockBuilder('Magento\\Framework\\App\\Response\\Http')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->once())->method('getResponse')->willReturn($this->response);
     $this->request = $this->getMockBuilder('Magento\\Framework\\App\\RequestInterface')->getMockForAbstractClass();
     $this->context->expects($this->once())->method('getRequest')->willReturn($this->request);
     $this->feedRepository = $this->getMockBuilder('Magento\\SampleServiceContractNew\\API\\FeedRepositoryInterface')->getMockForAbstractClass();
     $this->feedTransformer = $this->getMockBuilder('Magento\\SampleServiceContractNew\\Model\\FeedTransformer')->disableOriginalConstructor()->getMock();
     $this->controller = $objectManager->getObject('Magento\\SampleServiceContractNew\\Controller\\Feed\\View', ['feedRepository' => $this->feedRepository, 'feedTransformer' => $this->feedTransformer, 'context' => $this->context]);
 }
Example #7
0
 /**
  * Init mocks and model
  */
 public function setUp()
 {
     $this->contextMock = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', ['getEventManager', 'getStoreConfig', 'getScopeConfig'], [], '', false);
     $this->priceCurrencyMock = $this->getMock('Magento\\Directory\\Model\\PriceCurrency', [], [], '', false);
     $this->taxHelperMock = $this->getMock('Magento\\Tax\\Helper\\Data', [], [], '', false);
     $eventManagerMock = $this->getMockBuilder('Magento\\Framework\\Event\\ManagerInterface')->disableOriginalConstructor()->getMockForAbstractClass();
     $storeConfigMock = $this->getMockBuilder('Magento\\Store\\Model\\Store\\Config')->disableOriginalConstructor()->getMock();
     $scopeConfigMock = $this->getMockForAbstractClass('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $this->contextMock->expects($this->any())->method('getEventManager')->will($this->returnValue($eventManagerMock));
     $this->contextMock->expects($this->any())->method('getStoreConfig')->will($this->returnValue($storeConfigMock));
     $this->contextMock->expects($this->any())->method('getScopeConfig')->will($this->returnValue($scopeConfigMock));
     $this->model = new Adjustment($this->contextMock, $this->priceCurrencyMock, $this->taxHelperMock);
 }
Example #8
0
 protected function setUp()
 {
     $this->storeManager = $this->getMock('\\Magento\\Store\\Model\\StoreManagerInterface');
     $this->requestMock = $this->getMock('\\Magento\\Framework\\App\\RequestInterface');
     $this->reviewDataMock = $this->getMockBuilder('\\Magento\\Review\\Helper\\Data')->disableOriginalConstructor()->getMock();
     $this->reviewDataMock->expects($this->once())->method('getIsGuestAllowToWrite')->willReturn(true);
     $this->context = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', [], [], '', false);
     $this->context->expects($this->any())->method('getStoreManager')->will($this->returnValue($this->storeManager));
     $this->context->expects($this->any())->method('getRequest')->willReturn($this->requestMock);
     $this->productRepository = $this->getMock('\\Magento\\Catalog\\Api\\ProductRepositoryInterface');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->object = $this->objectManagerHelper->getObject('Magento\\Review\\Block\\Form', ['context' => $this->context, 'reviewData' => $this->reviewDataMock, 'productRepository' => $this->productRepository]);
 }
Example #9
0
 public function setUp()
 {
     $this->renderContextMock = $this->getMock('Magento\\Framework\\View\\Element\\UiComponent\\Context', ['getNamespace', 'getStorage', 'getRequestParam'], [], '', false);
     $this->contextMock = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', ['getAssetRepository'], [], '', false);
     $this->contentTypeFactoryMock = $this->getMock('Magento\\Ui\\ContentType\\ContentTypeFactory', [], [], '', false);
     $this->configurationBuilderMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponent\\ConfigBuilderInterface');
     $this->assetRepoMock = $this->getMock('Magento\\Framework\\View\\Asset\\Repository', [], [], '', false);
     $this->contextMock->expects($this->any())->method('getAssetRepository')->willReturn($this->assetRepoMock);
     $this->configFactoryMock = $this->getMock('Magento\\Framework\\View\\Element\\UiComponent\\ConfigFactory', ['create'], [], '', false);
     $this->configBuilderMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponent\\ConfigBuilderInterface', [], '', false);
     $this->dataProviderFactoryMock = $this->getMock('Magento\\Ui\\DataProvider\\Factory', [], [], '', false);
     $this->dataProviderManagerMock = $this->getMock('Magento\\Ui\\DataProvider\\Manager', [], [], '', false);
     $this->view = new \Magento\Ui\Component\Paging($this->contextMock, $this->renderContextMock, $this->contentTypeFactoryMock, $this->configFactoryMock, $this->configBuilderMock, $this->dataProviderFactoryMock, $this->dataProviderManagerMock);
 }
Example #10
0
 protected function setUp()
 {
     $this->contextMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\Context')->disableOriginalConstructor()->getMock();
     $this->requestMock = $this->getMockBuilder('Magento\\Framework\\App\\RequestInterface')->disableOriginalConstructor()->setMethods(['isSecure', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getParam', 'getCookie'])->getMock();
     $this->layoutMock = $this->getMockBuilder('Magento\\Framework\\View\\LayoutInterface')->disableOriginalConstructor()->getMock();
     $this->layoutUpdateMock = $this->getMockBuilder('Magento\\Framework\\View\\Layout\\ProcessorInterface')->disableOriginalConstructor()->getMock();
     $this->urlBuilderMock = $this->getMockBuilder('Magento\\Framework\\UrlInterface')->disableOriginalConstructor()->getMock();
     $this->contextMock->expects($this->any())->method('getRequest')->willReturn($this->requestMock);
     $this->contextMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock);
     $this->contextMock->expects($this->any())->method('getUrlBuilder')->willReturn($this->urlBuilderMock);
     $this->layoutMock->expects($this->any())->method('getUpdate')->willReturn($this->layoutUpdateMock);
     $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->blockJavascript = $objectManager->getObject('Magento\\PageCache\\Block\\Javascript', ['context' => $this->contextMock]);
 }
 /**
  * Set up
  *
  * @return void
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 protected function setUp()
 {
     $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->contextMock = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', ['getEventManager', 'getScopeConfig', 'getCacheState', 'getCache', 'getInlineTranslation', 'getSidResolver', 'getSession', 'getEscaper', 'getUrlBuilder'], [], '', false);
     $this->customerViewHelperMock = $this->getMock('Magento\\Customer\\Helper\\View', [], [], '', false);
     $this->persistentSessionHelperMock = $this->getMock('Magento\\Persistent\\Helper\\Session', ['getSession'], [], '', false);
     $this->customerRepositoryMock = $this->getMockForAbstractClass('Magento\\Customer\\Api\\CustomerRepositoryInterface', [], '', false, true, true, ['getById']);
     $this->eventManagerMock = $this->getMockForAbstractClass('Magento\\Framework\\Event\\ManagerInterface', [], '', false, true, true, ['dispatch']);
     $this->scopeConfigMock = $this->getMockForAbstractClass('Magento\\Framework\\App\\Config\\ScopeConfigInterface', [], '', false, true, true, ['getValue']);
     $this->cacheStateMock = $this->getMockForAbstractClass('Magento\\Framework\\App\\Cache\\StateInterface', [], '', false, true, true, ['isEnabled']);
     $this->cacheMock = $this->getMockForAbstractClass('Magento\\Framework\\App\\CacheInterface', [], '', false, true, true, ['load']);
     $this->sidResolverMock = $this->getMockForAbstractClass('Magento\\Framework\\Session\\SidResolverInterface', [], '', false, true, true, ['getSessionIdQueryParam']);
     $this->sessionMock = $this->getMockForAbstractClass('Magento\\Framework\\Session\\SessionManagerInterface', [], '', false, true, true, ['getSessionId']);
     $this->escaperMock = $this->getMockForAbstractClass('Magento\\Framework\\Escaper', [], '', false, true, true, ['escapeHtml']);
     $this->urlBuilderMock = $this->getMockForAbstractClass('Magento\\Framework\\UrlInterface', [], '', false, true, true, ['getUrl']);
     $this->contextMock->expects($this->once())->method('getEventManager')->willReturn($this->eventManagerMock);
     $this->contextMock->expects($this->once())->method('getScopeConfig')->willReturn($this->scopeConfigMock);
     $this->contextMock->expects($this->once())->method('getCacheState')->willReturn($this->cacheStateMock);
     $this->contextMock->expects($this->once())->method('getCache')->willReturn($this->cacheMock);
     $this->contextMock->expects($this->once())->method('getSidResolver')->willReturn($this->sidResolverMock);
     $this->contextMock->expects($this->once())->method('getSession')->willReturn($this->sessionMock);
     $this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock);
     $this->contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilderMock);
     $this->additional = $this->objectManager->getObject('Magento\\Persistent\\Block\\Header\\Additional', ['context' => $this->contextMock, 'customerViewHelper' => $this->customerViewHelperMock, 'persistentSessionHelper' => $this->persistentSessionHelperMock, 'customerRepository' => $this->customerRepositoryMock, 'data' => []]);
 }
Example #12
0
 public function setUp()
 {
     $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->rendererPool = $this->getMockBuilder('Magento\\Framework\\Pricing\\Render\\RendererPool')->disableOriginalConstructor()->setMethods(['createAmountRender'])->getMock();
     $layout = $this->getMock('Magento\\Framework\\View\\LayoutInterface');
     $eventManager = $this->getMock('Magento\\Framework\\Event\\ManagerInterface');
     $scopeConfigMock = $this->getMockForAbstractClass('Magento\\Framework\\App\\Config\\ScopeConfigInterface');
     $storeConfig = $this->getMockBuilder('Magento\\Store\\Model\\Store\\Config')->disableOriginalConstructor()->getMock();
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\Context')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getLayout')->will($this->returnValue($layout));
     $this->context->expects($this->any())->method('getEventManager')->will($this->returnValue($eventManager));
     $this->context->expects($this->any())->method('getStoreConfig')->will($this->returnValue($storeConfig));
     $this->context->expects($this->any())->method('getScopeConfig')->will($this->returnValue($scopeConfigMock));
     $this->saleable = $this->getMock('Magento\\Framework\\Pricing\\SaleableInterface');
     $this->price = $this->getMock('Magento\\Framework\\Pricing\\Price\\PriceInterface');
     $this->model = $this->objectManager->getObject('Magento\\Framework\\Pricing\\Render\\PriceBox', ['context' => $this->context, 'saleableItem' => $this->saleable, 'price' => $this->price, 'rendererPool' => $this->rendererPool]);
 }
Example #13
0
 public function testConstructMethod()
 {
     $data = [];
     $customerId = 25;
     $this->customerSession->expects($this->once())->method('getCustomerId')->will($this->returnValue($customerId));
     $statuses = ['pending', 'processing', 'comlete'];
     $this->orderConfig->expects($this->once())->method('getVisibleOnFrontStatuses')->will($this->returnValue($statuses));
     $orderCollection = $this->getMock('Magento\\Sales\\Model\\ResourceModel\\Order\\Collection', ['addFieldToSelect', 'addFieldToFilter', 'setOrder'], [], '', false, false);
     $this->context->expects($this->any())->method('getPageConfig')->willReturn($this->pageConfig);
     $orderCollection->expects($this->at(0))->method('addFieldToSelect')->with($this->equalTo('*'))->will($this->returnSelf());
     $orderCollection->expects($this->at(1))->method('addFieldToFilter')->with('status', $this->equalTo(['in' => $statuses]))->will($this->returnSelf());
     $orderCollection->expects($this->at(2))->method('setOrder')->with('created_at', 'desc')->will($this->returnSelf());
     $this->orderCollectionFactoryInterface->expects($this->atLeastOnce())->method('create')->will($this->returnValue($orderCollection));
     $this->pageConfig->expects($this->atLeastOnce())->method('getTitle')->willReturn($this->pageTitleMock);
     $this->pageTitleMock->expects($this->atLeastOnce())->method('set')->willReturnSelf();
     $this->model = new \Magento\Sales\Block\Order\History($this->context, $this->orderCollectionFactory, $this->customerSession, $this->orderConfig, $data);
     $this->assertEquals($orderCollection, $this->model->getOrders());
 }
Example #14
0
 public function setUp()
 {
     $this->objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
     $this->actionPool = $this->getMock('\\Magento\\Ui\\Component\\Control\\ActionPool', [], [], '', false);
     $this->optionsFactory = $this->getMock('\\Magento\\Ui\\Component\\Listing\\OptionsFactory', [], [], '', false);
     $this->rowPool = $this->getMock('\\Magento\\Ui\\Component\\Listing\\RowPool', [], [], '', false);
     $this->renderContext = $this->getMock('\\Magento\\Framework\\View\\Element\\UiComponent\\Context', [], [], '', false);
     $this->templateContext = $this->getMock('Magento\\Framework\\View\\Element\\Template\\Context', [], [], '', false);
     $this->configStorage = $this->getMock('Magento\\Ui\\Context\\ConfigurationStorage', [], [], '', false);
     $this->localeDate = $this->getMock('Magento\\Framework\\Stdlib\\DateTime\\Timezone', [], [], '', false);
     $this->urlBuilder = $this->getMock('Magento\\Backend\\Model\\Url', ['getUrl'], [], '', false);
     $this->templateContext->expects($this->once())->method('getLocaleDate')->willReturn($this->localeDate);
     $this->templateContext->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilder);
     $this->contentTypeFactory = $this->getMock('Magento\\Ui\\ContentType\\ContentTypeFactory', [], [], '', false);
     $this->configurationFactory = $this->getMock('Magento\\Framework\\View\\Element\\UiComponent\\ConfigFactory', [], [], '', false);
     $configurationBuilder = $this->getMock('Magento\\Framework\\View\\Element\\UiComponent\\ConfigBuilderInterface', ['toJson'], [], '', false);
     $this->configuration = $this->getMock('Magento\\Ui\\Context\\Configuration', [], [], '', false);
     $this->renderContext->expects($this->any())->method('getStorage')->willReturn($this->configStorage);
     $this->listingView = $this->objectManagerHelper->getObject('\\Magento\\Ui\\Component\\Listing', ['context' => $this->templateContext, 'renderContext' => $this->renderContext, 'contentTypeFactory' => $this->contentTypeFactory, 'configFactory' => $this->configurationFactory, 'configBuilder' => $configurationBuilder, 'optionsFactory' => $this->optionsFactory, 'actionPool' => $this->actionPool, 'dataProviderRowPool' => $this->rowPool]);
 }
Example #15
0
 public function testConstructMethod()
 {
     $data = [];
     $attribute = ['customer_id', 'status'];
     $customerId = 25;
     $layout = $this->getMock('Magento\\Framework\\View\\Layout', ['getBlock'], [], '', false, false);
     $this->context->expects($this->once())->method('getLayout')->will($this->returnValue($layout));
     $this->customerSession->expects($this->once())->method('getCustomerId')->will($this->returnValue($customerId));
     $statuses = ['pending', 'processing', 'complete'];
     $this->orderConfig->expects($this->once())->method('getVisibleOnFrontStatuses')->will($this->returnValue($statuses));
     $orderCollection = $this->getMock('Magento\\Sales\\Model\\ResourceModel\\Order\\Collection', ['addAttributeToSelect', 'addFieldToFilter', 'addAttributeToFilter', 'addAttributeToSort', 'setPageSize', 'load'], [], '', false, false);
     $this->orderCollectionFactory->expects($this->once())->method('create')->will($this->returnValue($orderCollection));
     $orderCollection->expects($this->at(0))->method('addAttributeToSelect')->with($this->equalTo('*'))->will($this->returnSelf());
     $orderCollection->expects($this->at(1))->method('addAttributeToFilter')->with($attribute[0], $this->equalTo($customerId))->willReturnSelf();
     $orderCollection->expects($this->at(2))->method('addAttributeToFilter')->with($attribute[1], $this->equalTo(['in' => $statuses]))->will($this->returnSelf());
     $orderCollection->expects($this->at(3))->method('addAttributeToSort')->with('created_at', 'desc')->will($this->returnSelf());
     $orderCollection->expects($this->at(4))->method('setPageSize')->with('5')->will($this->returnSelf());
     $orderCollection->expects($this->at(5))->method('load')->will($this->returnSelf());
     $this->block = new \Magento\Sales\Block\Order\Recent($this->context, $this->orderCollectionFactory, $this->customerSession, $this->orderConfig, $data);
     $this->assertEquals($orderCollection, $this->block->getOrders());
 }
Example #16
0
 /**
  * Create mock object for context
  */
 private function initContextMock()
 {
     $this->store = $this->getMockBuilder(Store::class)->disableOriginalConstructor()->setMethods(['getId', '__wakeup'])->getMock();
     $this->storeManager = $this->getMockBuilder(StoreManager::class)->disableOriginalConstructor()->setMethods(['getStore', '__wakeup'])->getMock();
     $this->storeManager->expects(static::any())->method('getStore')->willReturn($this->store);
     $this->urlBuilder = $this->getMockBuilder('Magento\\Framework\\UrlInterface')->getMockForAbstractClass();
     $this->requestMock = $this->getMockBuilder('Magento\\Framework\\App\\RequestInterface')->getMockForAbstractClass();
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\Template\\Context')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getRequest')->willReturn($this->requestMock);
     $this->context->expects($this->any())->method('getUrlBuilder')->willReturn($this->urlBuilder);
     $this->context->expects($this->any())->method('getStoreManager')->willReturn($this->storeManager);
 }
Example #17
0
 public function testGetIdentities()
 {
     $websiteId = 1;
     $storeId = null;
     $productTags = ['catalog_product_1'];
     $limit = 5;
     $storeManager = $this->getMock('Magento\\Store\\Model\\StoreManager', ['getStore'], [], '', false);
     $this->context->expects($this->once())->method('getStoreManager')->will($this->returnValue($storeManager));
     $store = $this->getMock('Magento\\Store\\Model', ['getWebsiteId'], [], '', false);
     $store->expects($this->once())->method('getWebsiteId')->will($this->returnValue($websiteId));
     $storeManager->expects($this->once())->method('getStore')->with($this->equalTo($storeId))->will($this->returnValue($store));
     $product = $this->getMock('Magento\\Catalog\\Model\\Product', ['__wakeUp', 'getIdentities', 'getWebsiteIds'], [], '', false);
     $product->expects($this->once())->method('getIdentities')->will($this->returnValue($productTags));
     $product->expects($this->atLeastOnce())->method('getWebsiteIds')->will($this->returnValue([$websiteId]));
     $item = $this->getMock('Magento\\Sales\\Model\\Resource\\Order\\Item', ['__wakeup', 'getProduct'], [], '', false);
     $item->expects($this->atLeastOnce())->method('getProduct')->will($this->returnValue($product));
     $order = $this->getMock('Magento\\Sales\\Model\\Order', ['__wakeup', 'getParentItemsRandomCollection'], [], '', false);
     $order->expects($this->atLeastOnce())->method('getParentItemsRandomCollection')->with($this->equalTo($limit))->will($this->returnValue([$item]));
     $this->createBlockObject();
     $this->assertSame($this->block, $this->block->setOrders([$order]));
     $this->assertEquals($productTags, $this->block->getIdentities());
 }