Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSearchTermSuccessSaveMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\CatalogSearch\Test\Page\Adminhtml\CatalogSearchIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertSearchTermSuccessSaveMessage extends AbstractConstraint
17 {
21  const SUCCESS_MESSAGE = 'You saved the search term.';
22 
29  public function processAssert(CatalogSearchIndex $indexPage)
30  {
31  $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessage();
32  \PHPUnit\Framework\Assert::assertEquals(
33  self::SUCCESS_MESSAGE,
34  $actualMessage,
35  'Wrong success message is displayed.'
36  . PHP_EOL . "Expected: " . self::SUCCESS_MESSAGE
37  . PHP_EOL . "Actual: " . $actualMessage
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Search term success save message is present.';
49  }
50 }