Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertOrderOnHoldSuccessMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertOrderOnHoldSuccessMessage extends AbstractConstraint
17 {
18  /* tags */
19  const SEVERITY = 'low';
20  /* end tags */
21 
25  const SINGLE_SUCCESS_ON_HOLD_MESSAGE = 'You put the order on hold.';
26 
30  const MULTIPLE_SUCCESS_ON_HOLD_MESSAGE = 'You have put %d order(s) on hold.';
31 
39  public function processAssert(OrderIndex $orderIndex, $ordersCount = null)
40  {
41  $successOnHoldMessage = ($ordersCount > 1)
42  ? sprintf(self::MULTIPLE_SUCCESS_ON_HOLD_MESSAGE, $ordersCount)
44 
45  \PHPUnit\Framework\Assert::assertEquals(
46  $successOnHoldMessage,
47  $orderIndex->getMessagesBlock()->getSuccessMessage()
48  );
49  }
50 
56  public function toString()
57  {
58  return 'On hold success message is displayed on order view page.';
59  }
60 }