Skip to content

Commit 2bc10a2

Browse files
committed
ENGCOM-3491: WebAPI test fix.
1 parent 3998176 commit 2bc10a2

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

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

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
/**
1313
* Class OrderCommentAddTest
14+
*
1415
* @package Magento\Sales\Service\V1
1516
*/
1617
class 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

Comments
 (0)