Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCartPriceRuleConditionIsApplied.php
Go to the documentation of this file.
1 <?php
8 
13 {
19  protected function assert()
20  {
21  $this->checkoutCart->getTotalsBlock()->waitForShippingPriceBlock();
22  $this->checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
23  $actualPrices['sub_total'] = $this->checkoutCart->getTotalsBlock()->getSubtotal();
24  $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getGrandTotal();
25  $actualPrices['discount'] = $this->checkoutCart->getTotalsBlock()->getDiscount();
26  $expectedPrices = $this->cartPrice;
27 
28  \PHPUnit\Framework\Assert::assertEquals(
29  $expectedPrices,
30  $actualPrices,
31  'Wrong total cart prices are displayed.'
32  );
33  }
34 
40  public function toString()
41  {
42  return "Shopping cart subtotal doesn't equal to grand total - price rule has been applied.";
43  }
44 }