Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertShippingPriceWithCustomCurrency.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 use Magento\Checkout\Test\Page\CheckoutOnepage;
12 use Magento\Mtf\TestStep\TestStepFactory;
14 use Magento\CurrencySymbol\Test\Fixture\CurrencySymbolEntity;
15 
19 class AssertShippingPriceWithCustomCurrency extends AbstractConstraint
20 {
33  public function processAssert(
34  CmsIndex $cmsIndex,
35  CheckoutOnepage $checkoutOnepage,
36  TestStepFactory $testStepFactory,
37  CatalogProductSimple $product,
38  CurrencySymbolEntity $currencySymbol,
40  array $shipping
41  ) {
42  $cmsIndex->open();
43  $cmsIndex->getLinksBlock()->waitWelcomeMessage();
44  $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol);
45  $testStepFactory->create(
46  \Magento\Checkout\Test\TestStep\AddProductsToTheCartStep::class,
47  ['products' => [$product]]
48  )->run();
49  $testStepFactory->create(\Magento\Checkout\Test\TestStep\ProceedToCheckoutStep::class)->run();
50  \PHPUnit\Framework\Assert::assertEquals(
52  $checkoutOnepage->getShippingMethodBlock()->getShippingMethodAmount($shipping),
53  'Shipping amount is not correct in the checkout page.'
54  );
55  }
56 
62  public function toString()
63  {
64  return 'Shipping amount is correct in the checkout page.';
65  }
66 }
$currencySymbol
Definition: matrix.phtml:14
processAssert(CmsIndex $cmsIndex, CheckoutOnepage $checkoutOnepage, TestStepFactory $testStepFactory, CatalogProductSimple $product, CurrencySymbolEntity $currencySymbol, $shippingAmount, array $shipping)