11
11
12
12
/**
13
13
* Class OrderCommentAddTest
14
+ *
14
15
* @package Magento\Sales\Service\V1
15
16
*/
16
17
class OrderStatusHistoryAddTest extends WebapiAbstract
@@ -48,7 +49,7 @@ public function testOrderCommentAdd()
48
49
OrderStatusHistoryInterface::CREATED_AT => null ,
49
50
OrderStatusHistoryInterface::PARENT_ID => $ order ->getId (),
50
51
OrderStatusHistoryInterface::ENTITY_NAME => null ,
51
- OrderStatusHistoryInterface::STATUS => null ,
52
+ OrderStatusHistoryInterface::STATUS => $ order -> getStatus () ,
52
53
OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT => 1 ,
53
54
];
54
55
@@ -69,25 +70,27 @@ public function testOrderCommentAdd()
69
70
70
71
//Verification
71
72
$ comments = $ order ->load ($ order ->getId ())->getAllStatusHistory ();
73
+ $ comment = reset ($ comments );
72
74
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
+ );
92
95
}
93
96
}
0 commit comments