Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCatalogPriceRuleNoticeMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertCatalogPriceRuleNoticeMessage extends AbstractConstraint
16 {
17  const NOTICE_MESSAGE_RULES = 'We found updated rules that are not applied.';
18  const NOTICE_MESSAGE_APPLY = ' Please click "Apply Rules" to update your catalog.';
19 
28  public function processAssert(
29  CatalogRuleIndex $pageCatalogRuleIndex
30  ) {
31  $actualMessage = $pageCatalogRuleIndex->getMessagesBlock()->getNoticeMessage();
32  \PHPUnit\Framework\Assert::assertEquals(
33  self::NOTICE_MESSAGE_RULES . self::NOTICE_MESSAGE_APPLY,
34  $actualMessage,
35  'Wrong notice message is displayed.'
36  . "\nExpected: " . self::NOTICE_MESSAGE_RULES . self::NOTICE_MESSAGE_APPLY
37  . "\nActual: " . $actualMessage
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Assert that notice message is displayed';
49  }
50 }