22 private $observerMock;
25 private $fullPageCacheMock;
32 $this->_configMock = $this->createPartialMock(\
Magento\PageCache\Model\Config::class, [
'getType',
'isEnabled']);
33 $this->_cacheMock = $this->createPartialMock(\
Magento\Framework\
App\PageCache\Cache::class, [
'clean']);
34 $this->fullPageCacheMock = $this->createPartialMock(\
Magento\PageCache\Model\Cache\Type::class, [
'clean']);
35 $this->observerMock = $this->createMock(\
Magento\Framework\Event\Observer::class);
37 $this->_model = new \Magento\PageCache\Observer\FlushAllCache(
42 $reflection = new \ReflectionClass(\
Magento\PageCache\
Observer\FlushAllCache::class);
43 $reflectionProperty = $reflection->getProperty(
'fullPageCache');
44 $reflectionProperty->setAccessible(
true);
45 $reflectionProperty->setValue($this->_model, $this->fullPageCacheMock);
53 $this->_configMock->expects(
58 $this->returnValue(\
Magento\PageCache\Model\Config::BUILT_IN)
61 $this->fullPageCacheMock->expects($this->once())->method(
'clean');
62 $this->_model->execute($this->observerMock);