Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ShoppingCartWithFreeShippingTest.php
Go to the documentation of this file.
1 <?php
8 
22 class ShoppingCartWithFreeShippingTest extends \Magento\Mtf\TestCase\Injectable
23 {
27  private $testStepFactory;
28 
35  public function __inject(
36  \Magento\Mtf\TestStep\TestStepFactory $testStepFactory
37  ) {
38  $this->testStepFactory = $testStepFactory;
39  }
40 
50  \Magento\SalesRule\Test\Fixture\SalesRule $salesRule,
51  \Magento\Catalog\Test\Fixture\CatalogProductSimple $product,
52  \Magento\Checkout\Test\Fixture\Cart $cart
53  ) {
54  $salesRule->persist();
55  $product->persist();
56 
57  $this->testStepFactory->create(
58  \Magento\Checkout\Test\TestStep\AddProductsToTheCartStep::class,
59  ['products' => [$product]]
60  )->run();
61 
62  $this->testStepFactory->create(
63  \Magento\Checkout\Test\TestStep\EstimateShippingAndTaxStep::class,
64  ['products' => [$product], 'cart' => $cart]
65  )->run();
66  }
67 
73  public function tearDown()
74  {
75  $this->testStepFactory->create(\Magento\SalesRule\Test\TestStep\DeleteAllSalesRuleStep::class)->run();
76  }
77 }
__inject(\Magento\Mtf\TestStep\TestStepFactory $testStepFactory)
testRuleWithFreeShippingByWeight(\Magento\SalesRule\Test\Fixture\SalesRule $salesRule, \Magento\Catalog\Test\Fixture\CatalogProductSimple $product, \Magento\Checkout\Test\Fixture\Cart $cart)