Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/code/Magento/Sales/Api/Data/OrderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,13 @@ public function setItems($items);
*/
public function getBillingAddress();

/**
* Gets the shipping address, if any, for the order.
*
* @return \Magento\Sales\Api\Data\OrderAddressInterface|null Shipping address. Otherwise, null.
*/
public function getShippingAddress();

/**
* Sets the billing address, if any, for the order.
*
Expand All @@ -1536,6 +1543,14 @@ public function getBillingAddress();
*/
public function setBillingAddress(\Magento\Sales\Api\Data\OrderAddressInterface $billingAddress = null);

/**
* Sets the shipping address, if any, for the order.
*
* @param \Magento\Sales\Api\Data\OrderAddressInterface $shippingAddress
* @return $this
*/
public function setShippingAddress(\Magento\Sales\Api\Data\OrderAddressInterface $shippingAddress = null);

/**
* Gets order payment
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testOrderGet()
'increment_id' => self::ORDER_INCREMENT_ID,
];
$expectedPayments = ['method' => 'checkmo'];
$expectedBillingAddressNotEmpty = [
$expectedAddressNotEmpty = [
'city',
'postcode',
'lastname',
Expand Down Expand Up @@ -78,8 +78,18 @@ public function testOrderGet()
}

$this->assertArrayHasKey('billing_address', $result);
foreach ($expectedBillingAddressNotEmpty as $field) {
$this->assertArrayHasKey($field, $result['billing_address']);
$this->assertArrayHasKey('shipping_address', $result);
foreach ($expectedAddressNotEmpty as $field) {
$this->assertArrayHasKey(
$field,
$result['billing_address'],
"Billing address should have field {$field}"
);
$this->assertArrayHasKey(
$field,
$result['shipping_address'],
"Shipping address should have field {$field}"
);
}

//check that nullable fields were marked as optional and were not sent
Expand Down