Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateOrderStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Fixture\FixtureFactory;
10 use Magento\Mtf\TestStep\TestStepInterface;
12 
16 class CreateOrderStep implements TestStepInterface
17 {
23  protected $order;
24 
30  private $fixtureFactory;
31 
37  public function __construct(OrderInjectable $order, FixtureFactory $fixtureFactory)
38  {
39  $this->order = $order;
40  $this->fixtureFactory = $fixtureFactory;
41  }
42 
48  public function run()
49  {
50  $this->order->persist();
51  $products = $this->order->getEntityId()['products'];
52  $cart['data']['items'] = ['products' => $products];
53 
54  return [
55  'products' => $products,
56  'order' => $this->order,
57  'cart' => $this->fixtureFactory->createByCode('cart', $cart)
58  ];
59  }
60 }
__construct(OrderInjectable $order, FixtureFactory $fixtureFactory)