public function testLoadSaveRemove() { $this->assertFalse($this->_model->load('non_existing_cache_id')); $cacheId = 'cache_id_' . __METHOD__; $expectedData = "Some data for {$cacheId}"; $this->assertTrue($this->_model->save($expectedData, $cacheId)); $this->assertEquals($expectedData, $this->_model->load($cacheId)); $this->_model->remove($cacheId); $this->assertFalse($this->_model->load($cacheId)); }
public function remove($id) { $start = microtime(true) * 1000; $res = parent::remove($id); $this->appendLog(self::TYPE_REMOVE, $id, round(microtime(true) * 1000 - $start)); return $res; }
/** * Clean order sidebar cache * * @param Varien_Event_Observer $observer * @return Enterprise_PageCache_Model_Observer */ public function registerNewOrder(Varien_Event_Observer $observer) { if (!$this->isCacheEnabled()) { return $this; } /** @var $blockContainer Enterprise_PageCache_Model_Container_Orders */ $blockContainer = Mage::getModel('enterprise_pagecache/container_orders'); $this->_cacheInstance->remove($blockContainer->getCacheId()); return $this; }
/** * Resave exception rules to cache storage * * @param Varien_Event_Observer $observer * @return Enterprise_PageCache_Model_Observer */ public function registerDesignExceptionsChange(Varien_Event_Observer $observer) { $this->_cacheInstance->remove(Enterprise_PageCache_Model_Processor::DESIGN_EXCEPTION_KEY); return $this; }
/** * Remove cache * * @param string $id * @return Mage_Core_Model_App */ public function removeCache($id) { $this->_cache->remove($id); return $this; }
/** * @dataProvider successFailureDataProvider * @param bool $result */ public function testRemove($result) { $this->_cacheFrontend->expects($this->once())->method('remove')->with('TEST_ID')->will($this->returnValue($result)); $this->assertEquals($result, $this->_model->remove('test_ID')); }