Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCancelSuccessMessageInShoppingCart.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutCart;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertCancelSuccessMessageInShoppingCart extends AbstractConstraint
16 {
20  const SUCCESS_MESSAGE = 'Your purchase process has been cancelled.';
21 
28  public function processAssert(CheckoutCart $checkoutCart)
29  {
30  $actualMessage = $checkoutCart->getMessagesBlock()->getSuccessMessage();
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::SUCCESS_MESSAGE,
33  $actualMessage,
34  'Success message is not present or has wrong text.'
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Cancel success message is present or has a correct text.';
46  }
47 }