protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_model = $objectManager->create('Magento\\Core\\Model\\Theme\\File'); /** @var $themeModel \Magento\Framework\View\Design\ThemeInterface */ $themeModel = $objectManager->create('Magento\\Framework\\View\\Design\\ThemeInterface'); $this->_theme = $themeModel->getCollection()->getFirstItem(); $this->_data = array('file_path' => 'main.css', 'file_type' => 'css', 'content' => 'content files', 'order' => 0, 'theme' => $this->_theme, 'theme_id' => $this->_theme->getId()); }
public function testGetCacheKeyInfo() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $context = $objectManager->get('Magento\\Framework\\App\\Http\\Context'); $context->setValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH, false, false); $block = $objectManager->get('Magento\\Framework\\View\\LayoutInterface')->createBlock('Magento\\Theme\\Block\\Html\\Footer'); $storeId = $objectManager->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getId(); $this->assertEquals(array('PAGE_FOOTER', $storeId, 0, $this->_theme->getId(), null), $block->getCacheKeyInfo()); }
/** * Retrieve cache identifier taking into account current area/package/theme/store * * @param string $suffix * @return string */ protected function _getCacheId($suffix = '') { return "LAYOUT_{$this->_theme->getArea()}_STORE{$this->_store->getId()}_{$this->_theme->getId()}{$suffix}"; }