Skip to content

Commit e4094c9

Browse files
committed
MAGETWO-95429: ShipOrder API with No Tracking Number Error Message
- Build stabilization
1 parent 14d4016 commit e4094c9

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

app/code/Magento/Sales/Model/Order/Shipment.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ public function register()
277277
}
278278

279279
/**
280+
* Retrieves the collection used to track the shipment's items
281+
*
280282
* @return mixed
281283
*/
282284
public function getItemsCollection()
@@ -295,6 +297,8 @@ public function getItemsCollection()
295297
}
296298

297299
/**
300+
* Retrieves all non-deleted items from the shipment
301+
*
298302
* @return array
299303
*/
300304
public function getAllItems()
@@ -309,6 +313,8 @@ public function getAllItems()
309313
}
310314

311315
/**
316+
* Retrieves an item from the shipment using its ID
317+
*
312318
* @param string|int $itemId
313319
* @return bool|\Magento\Sales\Model\Order\Shipment\Item
314320
*/
@@ -323,6 +329,8 @@ public function getItemById($itemId)
323329
}
324330

325331
/**
332+
* Adds an item to the shipment
333+
*
326334
* @param \Magento\Sales\Model\Order\Shipment\Item $item
327335
* @return $this
328336
*/
@@ -353,6 +361,8 @@ public function getTracksCollection()
353361
}
354362

355363
/**
364+
* Retrieves all available tracks in the collection that aren't deleted
365+
*
356366
* @return array
357367
*/
358368
public function getAllTracks()
@@ -367,6 +377,8 @@ public function getAllTracks()
367377
}
368378

369379
/**
380+
* Retrieves a track using its ID
381+
*
370382
* @param string|int $trackId
371383
* @return bool|\Magento\Sales\Model\Order\Shipment\Track
372384
*/
@@ -381,6 +393,8 @@ public function getTrackById($trackId)
381393
}
382394

383395
/**
396+
* Addes a track to the collection and associates the shipment to the track
397+
*
384398
* @param \Magento\Sales\Model\Order\Shipment\Track $track
385399
* @return $this
386400
*/
@@ -409,8 +423,7 @@ public function addTrack(\Magento\Sales\Model\Order\Shipment\Track $track)
409423
}
410424

411425
/**
412-
* Adds comment to shipment with additional possibility to send it to customer via email
413-
* and show it in customer account
426+
* Adds comment to shipment with option to send it to customer via email and show it in customer account
414427
*
415428
* @param \Magento\Sales\Model\Order\Shipment\Comment|string $comment
416429
* @param bool $notify

dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,15 @@ public function testShipOrder()
135135
/**
136136
* Tests that not providing a tracking number produces the correct error. See MAGETWO-95429
137137
* @expectedException \Exception
138+
* @codingStandardsIgnoreStart
138139
* @expectedExceptionMessageRegExp /Shipment Document Validation Error\(s\):(?:\n|\\n)Please enter a tracking number./
140+
* @codingStandardsIgnoreEnd
139141
* @magentoApiDataFixture Magento/Sales/_files/order_new.php
140142
*/
141143
public function testShipOrderWithoutTrackingNumberReturnsError()
142144
{
145+
$this->_markTestAsRestOnly('SOAP requires an tracking number to be provided so this case is not possible.');
146+
143147
/** @var \Magento\Sales\Model\Order $existingOrder */
144148
$existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class)
145149
->loadByIncrementId('100000001');

0 commit comments

Comments
 (0)