1111
1212/**
1313 * Class OrderCommentAddTest
14+ *
1415 * @package Magento\Sales\Service\V1
1516 */
1617class OrderStatusHistoryAddTest extends WebapiAbstract
@@ -48,7 +49,7 @@ public function testOrderCommentAdd()
4849 OrderStatusHistoryInterface::CREATED_AT => null ,
4950 OrderStatusHistoryInterface::PARENT_ID => $ order ->getId (),
5051 OrderStatusHistoryInterface::ENTITY_NAME => null ,
51- OrderStatusHistoryInterface::STATUS => null ,
52+ OrderStatusHistoryInterface::STATUS => $ order -> getStatus () ,
5253 OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT => 1 ,
5354 ];
5455
@@ -69,25 +70,27 @@ public function testOrderCommentAdd()
6970
7071 //Verification
7172 $ comments = $ order ->load ($ order ->getId ())->getAllStatusHistory ();
73+ $ comment = reset ($ comments );
7274
73- $ commentData = reset ($ comments );
74- foreach ($ commentData as $ key => $ value ) {
75- $ this ->assertEquals (
76- $ commentData [OrderStatusHistoryInterface::COMMENT ],
77- $ statusHistoryComment ->getComment ()
78- );
79- $ this ->assertEquals (
80- $ commentData [OrderStatusHistoryInterface::PARENT_ID ],
81- $ statusHistoryComment ->getParentId ()
82- );
83- $ this ->assertEquals (
84- $ commentData [OrderStatusHistoryInterface::IS_CUSTOMER_NOTIFIED ],
85- $ statusHistoryComment ->getIsCustomerNotified ()
86- );
87- $ this ->assertEquals (
88- $ commentData [OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT ],
89- $ statusHistoryComment ->getIsVisibleOnFront ()
90- );
91- }
75+ $ this ->assertEquals (
76+ $ commentData [OrderStatusHistoryInterface::COMMENT ],
77+ $ comment ->getComment ()
78+ );
79+ $ this ->assertEquals (
80+ $ commentData [OrderStatusHistoryInterface::PARENT_ID ],
81+ $ comment ->getParentId ()
82+ );
83+ $ this ->assertEquals (
84+ $ commentData [OrderStatusHistoryInterface::IS_CUSTOMER_NOTIFIED ],
85+ $ comment ->getIsCustomerNotified ()
86+ );
87+ $ this ->assertEquals (
88+ $ commentData [OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT ],
89+ $ comment ->getIsVisibleOnFront ()
90+ );
91+ $ this ->assertEquals (
92+ $ commentData [OrderStatusHistoryInterface::STATUS ],
93+ $ comment ->getStatus ()
94+ );
9295 }
9396}
0 commit comments