Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertRefundOrderStatusInCommentsHistory.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
9 use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertRefundOrderStatusInCommentsHistory extends AbstractConstraint
17 {
26  public function processAssert(
27  SalesOrderView $salesOrderView,
28  OrderIndex $salesOrder,
29  OrderInjectable $order
30  ) {
31  $salesOrder->open();
32  $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
33 
35  $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info');
36  $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment();
37 
38  \PHPUnit\Framework\Assert::assertContains(
39  $infoTab->getOrderStatus(),
40  $latestComment['status']
41  );
42  }
43 
49  public function toString()
50  {
51  return "Message with appropriate order status is available in Comments History section.";
52  }
53 }
$order
Definition: order.php:55