コード例 #1
0
ファイル: Save.php プロジェクト: AndreKlang/Lesti_Fpc
 /**
  * @test
  */
 public function testCmsBlockSaveAfter()
 {
     $this->_fpc->save('page1', 'page1_cache_id', array(sha1('cmsblock_1')));
     $this->_fpc->save('page2', 'page2_cache_id', array(sha1('cmsblock_2')));
     $cmsBlock = new Mage_Cms_Model_Block();
     $cmsBlock->setIdentifier('1');
     Mage::dispatchEvent('model_save_after', array('object' => $cmsBlock));
     $this->assertFalse($this->_fpc->load('page1_cache_id'));
     $this->assertEquals('page2', $this->_fpc->load('page2_cache_id'));
 }
コード例 #2
0
ファイル: Save.php プロジェクト: kurtinge/Lesti_Fpc
 /**
  * @test
  */
 public function testCmsBlockSaveAfter()
 {
     $page1Data = new \Lesti_Fpc_Model_Fpc_CacheItem('page1', time(), 'text/html');
     $this->_fpc->save($page1Data, 'page1_cache_id', array(sha1('cmsblock_1')));
     $page2Data = new \Lesti_Fpc_Model_Fpc_CacheItem('page2', time(), 'text/html');
     $this->_fpc->save($page2Data, 'page2_cache_id', array(sha1('cmsblock_2')));
     $cmsBlock = new Mage_Cms_Model_Block();
     $cmsBlock->setIdentifier('1');
     Mage::dispatchEvent('model_save_after', array('object' => $cmsBlock));
     $this->assertFalse($this->_fpc->load('page1_cache_id'));
     $this->assertEquals($page2Data, $this->_fpc->load('page2_cache_id'));
 }