/** * @magentoDataFixture Mage/Core/_files/layout_update.php */ public function testMakeTemporaryLayoutUpdatesPermanent() { /** @var $coreLayoutUpdate Mage_Core_Model_Resource_Layout_Update */ $coreLayoutUpdate = $this->_objectManager->create('Mage_Core_Model_Resource_Layout_Update'); $resultBefore = $coreLayoutUpdate->fetchUpdatesByHandle('test_handle'); $this->assertEquals('not_temporary', $resultBefore); /** @var $vdeLayoutUpdate Mage_DesignEditor_Model_Resource_Layout_Update */ $vdeLayoutUpdate = $this->_objectManager->create('Mage_DesignEditor_Model_Resource_Layout_Update'); $vdeLayoutUpdate->makeTemporaryLayoutUpdatesPermanent($this->_design->getDesignTheme()->getThemeId(), array(Mage_Core_Model_App::ADMIN_STORE_ID)); $resultAfter = $coreLayoutUpdate->fetchUpdatesByHandle('test_handle'); $this->assertEquals('not_temporarytemporary', $resultAfter); }
/** * Add css customization * * @param Mage_Core_Model_Layout $layout * @return Mage_Core_Model_Theme_Service */ protected function _addCssCustomization($layout) { /** @var $theme Mage_Core_Model_Theme_Files */ $customCssFile = $this->_design->getDesignTheme()->getCustomCssFile(); if ($customCssFile->getContent()) { $layout->getBlock('head')->addCss($customCssFile->getFilePath()); } return $this; }
/** * @magentoConfigFixture default/design/theme/allow_view_files_duplication 0 */ public function testGetViewUrlNoFilesDuplicationWithCaching() { Mage::app()->getLocale()->setLocale('en_US'); $theme = $this->_model->getDesignTheme(); $themeDesignParams = array('themeModel' => $theme); $cacheKey = "frontend|{$theme->getId()}|en_US"; Mage::app()->cleanCache(); $viewFile = 'images/logo.gif'; $this->_model->getViewFileUrl($viewFile, $themeDesignParams); $map = unserialize(Mage::app()->loadCache($cacheKey)); $this->assertTrue(count($map) == 1); $this->assertStringEndsWith('logo.gif', (string) array_pop($map)); $viewFile = 'images/logo_email.gif'; $this->_model->getViewFileUrl($viewFile, $themeDesignParams); $map = unserialize(Mage::app()->loadCache($cacheKey)); $this->assertTrue(count($map) == 2); $this->assertStringEndsWith('logo_email.gif', (string) array_pop($map)); }
public function testGetDesignTheme() { $this->assertEquals('test/default/default', $this->_model->getDesignTheme()); }
protected function tearDown() { $this->_designPackage->getDesignTheme()->setThemeId($this->_themeId); }
public function testGetDesignTheme() { $this->assertInstanceOf('Mage_Core_Model_Theme', $this->_model->getDesignTheme()); }