Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertStoreSuccessDeleteAndBackupMessages.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Backend\Test\Page\Adminhtml\StoreIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertStoreSuccessDeleteAndBackupMessages extends AbstractConstraint
17 {
21  const SUCCESS_BACKUP_MESSAGE = 'The database was backed up.';
22 
26  const SUCCESS_DELETE_MESSAGE = 'You deleted the store view.';
27 
34  public function processAssert(StoreIndex $storeIndex)
35  {
36  $actualMessages = $storeIndex->getMessagesBlock()->getSuccessMessages();
37  \PHPUnit\Framework\Assert::assertTrue(
38  in_array(self::SUCCESS_BACKUP_MESSAGE, $actualMessages) &&
39  in_array(self::SUCCESS_DELETE_MESSAGE, $actualMessages),
40  'Wrong success messages are displayed.'
41  );
42  }
43 
49  public function toString()
50  {
51  return 'Store view success delete and backup messages are present.';
52  }
53 }