public function testCleanType() { /* Setup preconditions */ $this->_model->save('some data with layout cache tag', 'some_cache_id', array('LAYOUT_GENERAL_CACHE_TAG')); $this->_model->invalidateType('layout'); $this->_model->cleanType('layout'); $this->assertFalse($this->_model->load('some_cache_id')); $this->assertEquals(array(), $this->_model->getInvalidatedTypes()); }
public function testCleanType() { $this->_model->allowUse('single_tag'); $this->_model->allowUse('multiple_tags'); $this->_cacheFrontend->expects($this->at(0))->method('clean')->with(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('TAG_ONE', 'TAG_TWO')); $this->_cacheFrontend->expects($this->at(1))->method('load')->with(strtoupper(Mage_Core_Model_Cache::INVALIDATED_TYPES))->will($this->returnValue(serialize(array('single_tag' => 1, 'multiple_tags' => 1)))); $this->_cacheFrontend->expects($this->at(2))->method('save')->with(serialize(array('single_tag' => 1)), strtoupper(Mage_Core_Model_Cache::INVALIDATED_TYPES)); $this->_model->cleanType('multiple_tags'); }