Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertTaxRuleSuccessSaveMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertTaxRuleSuccessSaveMessage extends AbstractConstraint
16 {
17  /* tags */
18  const SEVERITY = 'low';
19  /* end tags */
20 
21  const SUCCESS_MESSAGE = 'You saved the tax rule.';
22 
29  public function processAssert(TaxRuleIndex $taxRuleIndex)
30  {
31  $actualMessage = $taxRuleIndex->getMessagesBlock()->getSuccessMessage();
32  \PHPUnit\Framework\Assert::assertEquals(
33  self::SUCCESS_MESSAGE,
34  $actualMessage,
35  'Wrong success message is displayed.'
36  . "\nExpected: " . self::SUCCESS_MESSAGE
37  . "\nActual: " . $actualMessage
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Tax rule success create message is present.';
49  }
50 }