/** * @param AddressInterface $address * @param string $type */ private function specifyAddress(AddressInterface $address, $type) { $this->assertAddressType($type); $this->getElement(sprintf('%s_first_name', $type))->setValue($address->getFirstName()); $this->getElement(sprintf('%s_last_name', $type))->setValue($address->getLastName()); $this->getElement(sprintf('%s_street', $type))->setValue($address->getStreet()); $this->getElement(sprintf('%s_country', $type))->selectOption($address->getCountryCode() ?: 'Select'); $this->getElement(sprintf('%s_city', $type))->setValue($address->getCity()); $this->getElement(sprintf('%s_postcode', $type))->setValue($address->getPostcode()); if (null !== $address->getProvinceName()) { $this->waitForElement(5, sprintf('%s_province', $type)); $this->getElement(sprintf('%s_province', $type))->setValue($address->getProvinceName()); } }
/** * {@inheritdoc} */ public function specifyBillingAddress(AddressInterface $billingAddress) { $this->getElement('billing_first_name')->setValue($billingAddress->getFirstName()); $this->getElement('billing_last_name')->setValue($billingAddress->getLastName()); $this->getElement('billing_street')->setValue($billingAddress->getStreet()); $this->getElement('billing_country')->selectOption($billingAddress->getCountryCode() ?: 'Select'); $this->getElement('billing_city')->setValue($billingAddress->getCity()); $this->getElement('billing_postcode')->setValue($billingAddress->getPostcode()); if (null !== $billingAddress->getProvinceName()) { $this->waitForElement(5, 'billing_province'); $this->getElement('billing_province')->setValue($billingAddress->getProvinceName()); } }