Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertInvoicedOrderOnDashboard.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Mtf\TestStep\TestStepFactory;
11 
15 class AssertInvoicedOrderOnDashboard extends AbstractConstraint
16 {
26  public function processAssert(
27  TestStepFactory $stepFactory,
28  array $dashboardOrder,
29  array $argumentsList,
30  $expectedOrdersQuantityOnDashboard
31  ) {
32  $orderQty = $stepFactory->create(
33  \Magento\Backend\Test\TestStep\GetDashboardOrderStep::class,
34  ['argumentsList' => $argumentsList]
35  )->run()['dashboardOrder']['quantity'];
36  $invoicedOrdersQty = $orderQty - $dashboardOrder['quantity'];
37 
38  \PHPUnit\Framework\Assert::assertEquals(
39  $invoicedOrdersQty,
40  $expectedOrdersQuantityOnDashboard,
41  'Order quantity om admin dashboard is not correct.'
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Order information on dashboard is correct.';
53  }
54 }
processAssert(TestStepFactory $stepFactory, array $dashboardOrder, array $argumentsList, $expectedOrdersQuantityOnDashboard)