Skip to content

Commit 803e52b

Browse files
committed
MTA-3952: Refactoring comments history block in Order module
1 parent 27e1d24 commit 803e52b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Info/CommentsHistoryBlock.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ public function getComments()
6565
$result = [];
6666
$elements = $this->_rootElement->getElements($this->commentHistory);
6767
foreach ($elements as $key => $item) {
68-
$result[$key]['date'] = $item->find($this->commentHistoryDate)->getText();
69-
$result[$key]['time'] = $item->find($this->commentHistoryTime)->getText();
70-
$result[$key]['status'] = $item->find($this->commentHistoryStatus)->getText();
71-
$result[$key]['is_customer_notified'] = $item->find($this->commentHistoryNotifiedStatus)->getText();
72-
$result[$key]['comment'] = $item->find($this->comment)->getText();
68+
$result[$key] = [
69+
'date' => $item->find($this->commentHistoryDate)->getText(),
70+
'time' => $item->find($this->commentHistoryTime)->getText(),
71+
'status' => $item->find($this->commentHistoryStatus)->getText(),
72+
'is_customer_notified' => $item->find($this->commentHistoryNotifiedStatus)->getText(),
73+
'comment' => $item->find($this->comment)->getText()
74+
];
7375
}
7476

7577
return $result;
@@ -83,6 +85,6 @@ public function getComments()
8385
public function getLatestComment()
8486
{
8587
$comments = $this->getComments();
86-
return end($comments);
88+
return current($comments);
8789
}
8890
}

dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCaptureInCommentsHistory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\Sales\Test\Constraint;
88

9-
use Magento\Sales\Test\Fixture\OrderInjectable;
109
use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
1110
use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
1211
use Magento\Mtf\Constraint\AbstractConstraint;

0 commit comments

Comments
 (0)