Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 public function testGetInvalidatedTypes()
 {
     $this->_model->allowUse('single_tag');
     $this->_cacheFrontend->expects($this->once())->method('load')->with(strtoupper(Mage_Core_Model_Cache::INVALIDATED_TYPES))->will($this->returnValue(serialize(array('single_tag' => 1, 'non_existing_type' => 1))));
     $actualResult = $this->_model->getInvalidatedTypes();
     $this->assertInternalType('array', $actualResult);
     $this->assertCount(1, $actualResult);
     $this->assertArrayHasKey('single_tag', $actualResult);
     $this->assertInstanceOf('Varien_Object', $actualResult['single_tag']);
 }