Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertMyCartLinkRedirect.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertMyCartLinkRedirect extends AbstractConstraint
16 {
20  const CART_PAGE_TITLE = 'Shopping Cart';
21 
28  public function processAssert(CmsIndex $cmsIndex)
29  {
30  $cmsIndex->open();
31  $cmsIndex->getCartSidebarBlock()->openMiniCart();
32  \PHPUnit\Framework\Assert::assertEquals(
33  self::CART_PAGE_TITLE,
34  $cmsIndex->getTitleBlock()->getTitle(),
35  'Wrong page is displayed instead of the shopping cart page.'
36  );
37  }
38 
44  public function toString()
45  {
46  return 'My Cart link redirects to the shopping cart page.';
47  }
48 }