public function testGetCacheTags() { $this->assertContains(Mage_Core_Block_Abstract::CACHE_GROUP, $this->_block->getCacheTags()); $this->_block->setCacheTags(array('one', 'two')); $tags = $this->_block->getCacheTags(); $this->assertContains(Mage_Core_Block_Abstract::CACHE_GROUP, $tags); $this->assertContains('one', $tags); $this->assertContains('two', $tags); }
/** * Get cache information of a block * * @param Mage_Core_Block_Abstract $block * @return string * @author Fabrizio Branca <*****@*****.**> * @since 2011-01-24 */ protected function getCacheInfo(Mage_Core_Block_Abstract $block) { $cacheLifeTime = $block->getCacheLifetime(); $cacheInfo = ''; if (!is_null($cacheLifeTime)) { $cacheLifeTime = intval($cacheLifeTime) == 0 ? 'forever' : intval($cacheLifeTime) . ' sec'; $cacheInfo = 'Lifetime: ' . $cacheLifeTime . ', '; $cacheInfo .= 'Key:' . $block->getCacheKey() . ', '; $cacheInfo .= 'Tags: ' . implode(',', $block->getCacheTags()) . ''; } return $cacheInfo; }