Ejemplo n.º 1
0
 /**
  * Test flushing all cache types
  *
  * Emulates situation when some cache frontends reuse the same backend
  * Asserts that the flush is invoked only once per affected storage
  */
 public function testFlushAll()
 {
     $cacheTypes = ['foo', 'bar', 'baz'];
     $frontendFoo = $this->getMockForAbstractClass('Magento\\Framework\\Cache\\FrontendInterface');
     $frontendBar = $this->getMockForAbstractClass('Magento\\Framework\\Cache\\FrontendInterface');
     $frontendBaz = $this->getMockForAbstractClass('Magento\\Framework\\Cache\\FrontendInterface');
     $this->frontendPool->expects($this->exactly(3))->method('get')->will($this->returnValueMap([['foo', $frontendFoo], ['bar', $frontendBar], ['baz', $frontendBaz]]));
     $backendOne = $this->getMockForAbstractClass('Zend_Cache_Backend_Interface');
     $backendTwo = $this->getMockForAbstractClass('Zend_Cache_Backend_Interface');
     $frontendFoo->expects($this->once())->method('getBackend')->willReturn($backendOne);
     $frontendBar->expects($this->once())->method('getBackend')->willReturn($backendOne);
     $frontendBaz->expects($this->once())->method('getBackend')->willReturn($backendTwo);
     $backendOne->expects($this->once())->method('clean');
     $backendTwo->expects($this->once())->method('clean');
     $this->model->flush($cacheTypes);
 }
 function flush()
 {
     parent::flush();
     $this->_pageDatasources = array();
 }
 function flush()
 {
     parent::flush();
     $this->_pageEvents = array();
 }