Example #1
0
 /**
  * Return the specified numbered street line.
  *
  * @param int $lineNumber
  * @return string
  */
 public function getStreetLine($lineNumber)
 {
     $street = $this->_address->getStreet();
     return isset($street[$lineNumber - 1]) ? $street[$lineNumber - 1] : '';
 }
Example #2
0
 /**
  * Retrieve the Url for editing the specified address.
  *
  * @param \Magento\Customer\Service\V1\Data\Address $address
  * @return string
  */
 public function getAddressEditUrl($address)
 {
     return $this->_urlBuilder->getUrl('customer/address/edit', array('_secure' => true, 'id' => $address->getId()));
 }
Example #3
0
 /**
  * @param Address $address
  */
 private function _assertMinimumRequiredFields(Address $address)
 {
     $this->assertEquals($this->_expectedValues['firstname'], $address->getFirstname());
     $this->assertEquals($this->_expectedValues['lastname'], $address->getLastname());
     $this->assertEquals($this->_expectedValues['street'][0], $address->getStreet()[0]);
     $this->assertEquals($this->_expectedValues['city'], $address->getCity());
     $this->assertEquals($this->_expectedValues['country_id'], $address->getCountryId());
     $this->assertEquals($this->objectManagerHelper->getObject('\\Magento\\Customer\\Service\\V1\\Data\\RegionBuilder')->setRegionId($this->_expectedValues['region']['region_id'])->setRegion($this->_expectedValues['region']['region'])->create(), $address->getRegion());
     $this->assertEquals($this->_expectedValues['postcode'], $address->getPostcode());
     $this->assertEquals($this->_expectedValues['telephone'], $address->getTelephone());
 }
Example #4
0
 /**
  * Get URL of page, at which customer billing address can be set.
  *
  * @param \Magento\Customer\Service\V1\Data\Address $address
  * @return string
  */
 public function getSetAddressUrl($address)
 {
     return $this->getUrl('*/*/setBilling', array('id' => $address->getId()));
 }