Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Cache Class Reference
Inheritance diagram for Cache:

Public Member Functions

 flushMagentoCache ()
 
 flushCacheStorage ()
 
 isStorageCacheFlushed ()
 
 isMagentoCacheFlushed ()
 

Protected Member Functions

 getMessagesBlock ()
 

Protected Attributes

 $flushMagentoCacheButton = '[data-ui-id="adminhtml-cache-container-flush-magento-button"]'
 
 $flushCacheStorageButton = '[data-ui-id="adminhtml-cache-container-flush-system-button"]'
 
 $messagesSelector = '//ancestor::div//div[@id="messages"]'
 
 $messagesText
 

Detailed Description

Cache actions block.

Definition at line 15 of file Cache.php.

Member Function Documentation

◆ flushCacheStorage()

flushCacheStorage ( )

Flush cache storage.

Definition at line 59 of file Cache.php.

60  {
61  $this->_rootElement->find($this->flushCacheStorageButton)->click();
62  }

◆ flushMagentoCache()

flushMagentoCache ( )

Flush magento cache.

Definition at line 51 of file Cache.php.

52  {
53  $this->_rootElement->find($this->flushMagentoCacheButton)->click();
54  }

◆ getMessagesBlock()

getMessagesBlock ( )
protected

Get messages block.

Returns
\Magento\Backend\Test\Block\Messages

Definition at line 89 of file Cache.php.

90  {
91  return $this->blockFactory->create(
92  \Magento\Backend\Test\Block\Messages::class,
93  ['element' => $this->_rootElement->find($this->messagesSelector, Locator::SELECTOR_XPATH)]
94  );
95  }

◆ isMagentoCacheFlushed()

isMagentoCacheFlushed ( )

Is magento cache flushed successfully.

Returns
bool

Definition at line 79 of file Cache.php.

80  {
81  return $this->getMessagesBlock()->getSuccessMessage() == $this->messagesText['cache_magento_flushed'];
82  }

◆ isStorageCacheFlushed()

isStorageCacheFlushed ( )

Is storage cache flushed successfully.

Returns
bool

Definition at line 69 of file Cache.php.

70  {
71  return $this->getMessagesBlock()->getSuccessMessage() == $this->messagesText['cache_storage_flushed'];
72  }

Field Documentation

◆ $flushCacheStorageButton

$flushCacheStorageButton = '[data-ui-id="adminhtml-cache-container-flush-system-button"]'
protected

Definition at line 29 of file Cache.php.

◆ $flushMagentoCacheButton

$flushMagentoCacheButton = '[data-ui-id="adminhtml-cache-container-flush-magento-button"]'
protected

Definition at line 22 of file Cache.php.

◆ $messagesSelector

$messagesSelector = '//ancestor::div//div[@id="messages"]'
protected

Definition at line 36 of file Cache.php.

◆ $messagesText

$messagesText
protected
Initial value:
= [
'cache_storage_flushed' => 'You flushed the cache storage.',
'cache_magento_flushed' => 'The Magento cache storage has been flushed.',
]

Definition at line 43 of file Cache.php.


The documentation for this class was generated from the following file: