Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FillBillingAddressStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Fixture\Address;
10 use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex;
11 use Magento\Mtf\TestStep\TestStepInterface;
12 
16 class FillBillingAddressStep implements TestStepInterface
17 {
23  protected $orderCreateIndex;
24 
30  protected $billingAddress;
31 
37  protected $shippingAddress;
38 
44  protected $saveAddress;
45 
52 
60  public function __construct(
61  OrderCreateIndex $orderCreateIndex,
64  $saveAddress = 'No',
65  $setShippingAddress = true
66  ) {
67  $this->orderCreateIndex = $orderCreateIndex;
68  $this->billingAddress = $billingAddress;
69  $this->shippingAddress = $shippingAddress;
70  $this->saveAddress = $saveAddress;
71  $this->setShippingAddress = $setShippingAddress;
72  }
73 
79  public function run()
80  {
81  if ($this->shippingAddress !== null) {
82  $this->setShippingAddress = null;
83  }
84  $this->orderCreateIndex->getCreateBlock()
85  ->fillBillingAddress($this->billingAddress, $this->saveAddress, $this->setShippingAddress);
86 
87  return ['billingAddress' => $this->billingAddress];
88  }
89 }
__construct(OrderCreateIndex $orderCreateIndex, Address $billingAddress, Address $shippingAddress=null, $saveAddress='No', $setShippingAddress=true)