Skip to content

Commit a732ff6

Browse files
committed
#7760: M2.1.2 : Shipment Tracking REST API should throw an error if order doesn't exist.
1 parent 1b3304a commit a732ff6

File tree

1 file changed

+4
-0
lines changed
  • app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Shipment

1 file changed

+4
-0
lines changed

app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Shipment/TrackTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ protected function setUp()
8989
*/
9090
public function testSave()
9191
{
92+
$shipmentMock = $this->createMock(\Magento\Sales\Model\Order\Shipment::class);
93+
$orderMock = $this->createMock(\Magento\Sales\Model\Order::class);
9294
$this->entitySnapshotMock->expects($this->once())
9395
->method('isModified')
9496
->with($this->trackModelMock)
@@ -98,6 +100,8 @@ public function testSave()
98100
->with($this->equalTo($this->trackModelMock))
99101
->will($this->returnValue([]));
100102
$this->trackModelMock->expects($this->any())->method('getData')->willReturn([]);
103+
$this->trackModelMock->expects($this->atLeastOnce())->method('getShipment')->willReturn($shipmentMock);
104+
$shipmentMock->expects($this->atLeastOnce())->method('getOrder')->willReturn($orderMock);
101105
$this->trackResource->save($this->trackModelMock);
102106
$this->assertTrue(true);
103107
}

0 commit comments

Comments
 (0)