Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertItemsCounterInMiniShoppingCart.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Cms\Test\Page\CmsIndex;
11 
15 class AssertItemsCounterInMiniShoppingCart extends AbstractConstraint
16 {
24  public function processAssert(CmsIndex $cmsIndex, $totalItemsCountInShoppingCart)
25  {
26  $sidebar = $cmsIndex->getCartSidebarBlock();
27  $sidebar->openMiniCart();
28 
29  \PHPUnit\Framework\Assert::assertEquals(
30  $sidebar->getItemsQty(),
31  $totalItemsCountInShoppingCart,
32  'Wrong quantity of Cart items in mini shopping cart'
33  );
34  }
35 
41  public function toString()
42  {
43  return 'Products qty in cart is equal to fixtures count';
44  }
45 }