Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HoldCreatedOrderTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
11 use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
12 use Magento\Mtf\TestCase\Injectable;
13 
30 class HoldCreatedOrderTest extends Injectable
31 {
32  /* tags */
33  const MVP = 'yes';
34  /* end tags */
35 
41  protected $orderIndex;
42 
48  protected $salesOrderView;
49 
55  public function __prepare()
56  {
57  $this->objectManager->create(
58  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
59  ['configData' => 'checkmo, flatrate', 'rollback' => true]
60  )->run();
61  }
62 
70  public function __inject(OrderIndex $orderIndex, SalesOrderView $salesOrderView)
71  {
72  $this->orderIndex = $orderIndex;
73  $this->salesOrderView = $salesOrderView;
74  }
75 
82  public function test(OrderInjectable $order)
83  {
84  // Preconditions
85  $order->persist();
86 
87  // Steps
88  $this->orderIndex->open();
89  $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
90  $this->salesOrderView->getPageActions()->hold();
91 
92  return [
93  'customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer(),
94  ];
95  }
96 }
$order
Definition: order.php:55
__inject(OrderIndex $orderIndex, SalesOrderView $salesOrderView)