Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSearchTermSuccessDeleteMessage.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 AssertSearchTermSuccessDeleteMessage extends AbstractConstraint
17 {
18  /* tags */
19  const SEVERITY = 'high';
20  /* end tags */
21 
25  const SUCCESS_DELETE_MESSAGE = 'You deleted the search.';
26 
33  public function processAssert(CatalogSearchIndex $indexPage)
34  {
35  $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessage();
36  \PHPUnit\Framework\Assert::assertEquals(
37  self::SUCCESS_DELETE_MESSAGE,
38  $actualMessage,
39  'Wrong success message is displayed.'
40  . "\nExpected: " . self::SUCCESS_DELETE_MESSAGE
41  . "\nActual: " . $actualMessage
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Search term success delete message is present.';
53  }
54 }