Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertTaxRuleIsAppliedToAllPricesExcludingTax.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Fixture\FixtureInterface;
11 
16 {
22  protected $severeness = 'high';
23 
31  public function getCategoryPrices(FixtureInterface $product, $actualPrices)
32  {
33  $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductItem($product)->getPriceBlock();
34  $actualPrices['category_price_excl_tax'] = $priceBlock->getPriceExcludingTax();
35  $actualPrices['category_price_incl_tax'] = null;
36 
37  return $actualPrices;
38  }
39 
46  public function getProductPagePrices($actualPrices)
47  {
48  $viewBlock = $this->catalogProductView->getViewBlock();
49  $actualPrices['product_view_price_excl_tax'] = $viewBlock->getPriceBlock()->getPriceExcludingTax();
50  $actualPrices['product_view_price_incl_tax'] = null;
51 
52  return $actualPrices;
53  }
54 
61  public function getTotals($actualPrices)
62  {
63  $totalsBlock = $this->checkoutCart->getTotalsBlock();
64  $actualPrices['subtotal_excl_tax'] = $totalsBlock->getSubtotal();
65  $actualPrices['subtotal_incl_tax'] = null;
66  $actualPrices['discount'] = $totalsBlock->getDiscount();
67  $actualPrices['shipping_excl_tax'] = $totalsBlock->getShippingPrice();
68  $actualPrices['shipping_incl_tax'] = $totalsBlock->getShippingPriceInclTax();
69  $actualPrices['tax'] = $totalsBlock->getTax();
70  $actualPrices['grand_total_excl_tax'] = $totalsBlock->getGrandTotal();
71  $actualPrices['grand_total_incl_tax'] = null;
72 
73  return $actualPrices;
74  }
75 }