Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function fillAddressData(AddressInterface $address)
 {
     $this->getElement('first_name')->setValue($address->getFirstName());
     $this->getElement('last_name')->setValue($address->getLastName());
     $this->getElement('street')->setValue($address->getStreet());
     $this->getElement('country')->selectOption($address->getCountryCode());
     $this->getElement('city')->setValue($address->getCity());
     $this->getElement('postcode')->setValue($address->getPostcode());
 }
Пример #2
0
 /**
  * @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());
     }
 }
Пример #3
0
 /**
  * @param string $displayedAddress
  * @param AddressInterface $address
  *
  * @return bool
  */
 private function isAddressValid($displayedAddress, AddressInterface $address)
 {
     return $this->hasAddressPart($displayedAddress, $address->getCompany(), true) && $this->hasAddressPart($displayedAddress, $address->getFirstName()) && $this->hasAddressPart($displayedAddress, $address->getLastName()) && $this->hasAddressPart($displayedAddress, $address->getPhoneNumber(), true) && $this->hasAddressPart($displayedAddress, $address->getStreet()) && $this->hasAddressPart($displayedAddress, $address->getCity()) && $this->hasAddressPart($displayedAddress, $address->getProvinceCode(), true) && $this->hasAddressPart($displayedAddress, $this->getCountryName($address->getCountryCode())) && $this->hasAddressPart($displayedAddress, $address->getPostcode());
 }
Пример #4
0
 /**
  * {@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($this->getCountryNameOrDefault($billingAddress->getCountryCode()));
     $this->getElement('billing_city')->setValue($billingAddress->getCity());
     $this->getElement('billing_postcode')->setValue($billingAddress->getPostcode());
 }
Пример #5
0
 /**
  * {@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());
     }
 }