コード例 #1
0
ファイル: AddressingPage.php プロジェクト: remyma/Sylius
 /**
  * {@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());
 }
コード例 #2
0
ファイル: CreatePage.php プロジェクト: loic425/Sylius
 /**
  * {@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());
 }
コード例 #3
0
ファイル: AddressPage.php プロジェクト: sylius/sylius
 /**
  * @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());
     }
 }
コード例 #4
0
ファイル: CompletePage.php プロジェクト: ReissClothing/Sylius
 /**
  * @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());
 }
コード例 #5
0
ファイル: CheckoutContext.php プロジェクト: starspire/Sylius
 /**
  * @When /^I specify the billing (address as "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)" for "([^"]+)")$/
  * @When /^I specify the billing (address for "([^"]+)" from "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)")$/
  * @When /^I (do not specify any billing address) information$/
  */
 public function iSpecifyTheBillingAddressAs(AddressInterface $address)
 {
     $this->iChooseTheDifferentBillingAddress();
     $key = sprintf('billing_address_%s_%s', strtolower($address->getFirstName()), strtolower($address->getLastName()));
     $this->sharedStorage->set($key, $address);
     $this->addressPage->specifyBillingAddress($address);
 }
コード例 #6
0
ファイル: AddressBookContext.php プロジェクト: sylius/sylius
 /**
  * @Then /^(address "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+"(?:|, "[^"]+")) should be marked as my default address$/
  */
 public function addressShouldBeMarkedAsMyDefaultAddress(AddressInterface $address)
 {
     $actualFullName = $this->addressBookIndexPage->getFullNameOfDefaultAddress();
     $expectedFullName = sprintf('%s %s', $address->getFirstName(), $address->getLastName());
     Assert::same($expectedFullName, $actualFullName, sprintf('The default address should be of "%s", but is of "%s".', $expectedFullName, $actualFullName));
 }
コード例 #7
0
ファイル: AddressPage.php プロジェクト: GSadee/Sylius
 /**
  * {@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());
     }
 }