Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FillShippingInformationStep.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\Multishipping\Test\Page\MultishippingCheckoutShipping;
10 use Magento\Mtf\TestStep\TestStepInterface;
11 
15 class FillShippingInformationStep implements TestStepInterface
16 {
23 
29  protected $customer;
30 
36  protected $shippingMethod;
37 
43  public function __construct(
44  MultishippingCheckoutShipping $shippingInformation,
45  Customer $customer,
46  array $shippingMethod
47  ) {
48  $this->shippingInformation = $shippingInformation;
49  $this->shippingMethod = $shippingMethod;
50  $this->customer = $customer;
51  }
52 
58  public function run()
59  {
60  $shippingMethods = [];
61  for ($i = 0; $i < count($this->customer->getAddress()); $i++) {
62  $shippingMethods[] = $this->shippingMethod;
63  }
64  $this->shippingInformation->getShippingBlock()->selectShippingMethod($shippingMethods);
65  }
66 }
__construct(MultishippingCheckoutShipping $shippingInformation, Customer $customer, array $shippingMethod)
$i
Definition: gallery.phtml:31