Example #1
0
 /**
  * @test
  */
 public function testCmsPageSaveAfter()
 {
     $this->_fpc->save('page1', 'page1_cache_id', array(sha1('cms_1')));
     $this->_fpc->save('page2', 'page2_cache_id', array(sha1('cms_2')));
     $this->_fpc->save('page3', 'page3_cache_id', array(sha1('cms_3')));
     $page = new Mage_Cms_Model_Page();
     $page->setId(1);
     $page->setIdentifier('3');
     Mage::dispatchEvent('cms_page_save_after', array('object' => $page));
     $this->assertFalse($this->_fpc->load('page1_cache_id'));
     $this->assertFalse($this->_fpc->load('page3_cache_id'));
     $this->assertEquals('page2', $this->_fpc->load('page2_cache_id'));
 }
Example #2
0
 /**
  * @test
  */
 public function testCmsPageSaveAfter()
 {
     $page1Data = new \Lesti_Fpc_Model_Fpc_CacheItem('page1', time(), 'text/html');
     $this->_fpc->save($page1Data, 'page1_cache_id', array(sha1('cms_1')));
     $page2Data = new \Lesti_Fpc_Model_Fpc_CacheItem('page2', time(), 'text/html');
     $this->_fpc->save($page2Data, 'page2_cache_id', array(sha1('cms_2')));
     $page3Data = new \Lesti_Fpc_Model_Fpc_CacheItem('page3', time(), 'text/html');
     $this->_fpc->save($page3Data, 'page3_cache_id', array(sha1('cms_3')));
     $page = new Mage_Cms_Model_Page();
     $page->setId(1);
     $page->setIdentifier('3');
     Mage::dispatchEvent('cms_page_save_after', array('object' => $page));
     $this->assertFalse($this->_fpc->load('page1_cache_id'));
     $this->assertFalse($this->_fpc->load('page3_cache_id'));
     $this->assertEquals($page2Data, $this->_fpc->load('page2_cache_id'));
 }