/** * {@inheritdoc} */ public function getCacheKeyInfo() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCacheKeyInfo'); if (!$pluginInfo) { return parent::getCacheKeyInfo(); } else { return $this->___callPlugins('getCacheKeyInfo', func_get_args(), $pluginInfo); } }
public function testGetCacheKeyInfo() { $store = $this->getMockBuilder('\\Magento\\Store\\Model\\Store')->disableOriginalConstructor()->setMethods(['getId'])->getMock(); $store->expects($this->once())->method('getId')->willReturn(1); $this->storeManager->expects($this->once())->method('getStore')->willReturn($store); $theme = $this->getMock('\\Magento\\Framework\\View\\Design\\ThemeInterface'); $theme->expects($this->once())->method('getId')->willReturn('blank'); $this->design->expects($this->once())->method('getDesignTheme')->willReturn($theme); $this->httpContext->expects($this->once())->method('getValue')->willReturn('context_group'); $this->productsList->setData('conditions', 'some_serialized_conditions'); $this->request->expects($this->once())->method('getParam')->with('np')->willReturn(1); $cacheKey = ['CATALOG_PRODUCTS_LIST_WIDGET', 1, 'blank', 'context_group', 1, 5, 'some_serialized_conditions']; $this->assertEquals($cacheKey, $this->productsList->getCacheKeyInfo()); }