Skip to content

Commit 80933e0

Browse files
committed
MAGETWO-93057: [2.3] salesShipmentRepositoryV1 throws error when adding tracking
1 parent 1ebe5f1 commit 80933e0

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public function getPackages()
522522
}
523523

524524
/**
525-
* {@inheritdoc}
525+
* @inheritdoc
526526
* @codeCoverageIgnore
527527
*/
528528
public function setPackages(array $packages = null)
@@ -619,7 +619,7 @@ public function getCreatedAt()
619619
}
620620

621621
/**
622-
* {@inheritdoc}
622+
* @inheritdoc
623623
*/
624624
public function setCreatedAt($createdAt)
625625
{
@@ -751,95 +751,95 @@ public function setComments($comments = null)
751751
}
752752

753753
/**
754-
* {@inheritdoc}
754+
* @inheritdoc
755755
*/
756756
public function setStoreId($id)
757757
{
758758
return $this->setData(ShipmentInterface::STORE_ID, $id);
759759
}
760760

761761
/**
762-
* {@inheritdoc}
762+
* @inheritdoc
763763
*/
764764
public function setTotalWeight($totalWeight)
765765
{
766766
return $this->setData(ShipmentInterface::TOTAL_WEIGHT, $totalWeight);
767767
}
768768

769769
/**
770-
* {@inheritdoc}
770+
* @inheritdoc
771771
*/
772772
public function setTotalQty($qty)
773773
{
774774
return $this->setData(ShipmentInterface::TOTAL_QTY, $qty);
775775
}
776776

777777
/**
778-
* {@inheritdoc}
778+
* @inheritdoc
779779
*/
780780
public function setEmailSent($emailSent)
781781
{
782782
return $this->setData(ShipmentInterface::EMAIL_SENT, $emailSent);
783783
}
784784

785785
/**
786-
* {@inheritdoc}
786+
* @inheritdoc
787787
*/
788788
public function setOrderId($id)
789789
{
790790
return $this->setData(ShipmentInterface::ORDER_ID, $id);
791791
}
792792

793793
/**
794-
* {@inheritdoc}
794+
* @inheritdoc
795795
*/
796796
public function setCustomerId($id)
797797
{
798798
return $this->setData(ShipmentInterface::CUSTOMER_ID, $id);
799799
}
800800

801801
/**
802-
* {@inheritdoc}
802+
* @inheritdoc
803803
*/
804804
public function setShippingAddressId($id)
805805
{
806806
return $this->setData(ShipmentInterface::SHIPPING_ADDRESS_ID, $id);
807807
}
808808

809809
/**
810-
* {@inheritdoc}
810+
* @inheritdoc
811811
*/
812812
public function setBillingAddressId($id)
813813
{
814814
return $this->setData(ShipmentInterface::BILLING_ADDRESS_ID, $id);
815815
}
816816

817817
/**
818-
* {@inheritdoc}
818+
* @inheritdoc
819819
*/
820820
public function setShipmentStatus($shipmentStatus)
821821
{
822822
return $this->setData(ShipmentInterface::SHIPMENT_STATUS, $shipmentStatus);
823823
}
824824

825825
/**
826-
* {@inheritdoc}
826+
* @inheritdoc
827827
*/
828828
public function setIncrementId($id)
829829
{
830830
return $this->setData(ShipmentInterface::INCREMENT_ID, $id);
831831
}
832832

833833
/**
834-
* {@inheritdoc}
834+
* @inheritdoc
835835
*/
836836
public function setUpdatedAt($timestamp)
837837
{
838838
return $this->setData(ShipmentInterface::UPDATED_AT, $timestamp);
839839
}
840840

841841
/**
842-
* {@inheritdoc}
842+
* @inheritdoc
843843
*
844844
* @return \Magento\Sales\Api\Data\ShipmentExtensionInterface|null
845845
*/
@@ -849,7 +849,7 @@ public function getExtensionAttributes()
849849
}
850850

851851
/**
852-
* {@inheritdoc}
852+
* @inheritdoc
853853
*
854854
* @param \Magento\Sales\Api\Data\ShipmentExtensionInterface $extensionAttributes
855855
* @return $this

app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class ShipmentTest extends \PHPUnit\Framework\TestCase
2929
*/
3030
private $shipmentModel;
3131

32+
/**
33+
* @return void
34+
*/
3235
protected function setUp()
3336
{
3437
$helperManager = new ObjectManager($this);
@@ -40,12 +43,23 @@ protected function setUp()
4043
]);
4144
}
4245

46+
/**
47+
* Test to Returns increment id
48+
*
49+
* @return void
50+
*/
4351
public function testGetIncrementId()
4452
{
4553
$this->shipmentModel->setIncrementId('test_increment_id');
4654
$this->assertEquals('test_increment_id', $this->shipmentModel->getIncrementId());
4755
}
4856

57+
/**
58+
* Test to Retrieves comments collection
59+
*
60+
* @return void
61+
* @throws \ReflectionException
62+
*/
4963
public function testGetCommentsCollection()
5064
{
5165
$shipmentId = 1;
@@ -78,6 +92,12 @@ public function testGetCommentsCollection()
7892
self::assertEquals($this->commentCollection, $actual);
7993
}
8094

95+
/**
96+
* Test to Returns comments
97+
*
98+
* @return void
99+
* @throws \ReflectionException
100+
*/
81101
public function testGetComments()
82102
{
83103
$shipmentId = 1;

dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ public function testAddTrack()
7979
{
8080
$order = $this->getOrder('100000001');
8181

82-
/** @var ShipmentInterface $shipment */
83-
$shipment = $this->objectManager->create(ShipmentInterface::class);
84-
8582
/** @var ShipmentTrackInterface $track */
8683
$track = $this->objectManager->create(ShipmentTrackInterface::class);
8784
$track->setNumber('Test Number')

0 commit comments

Comments
 (0)