Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CustomersOrderCountReportEntityTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Reports\Test\Page\Adminhtml\CustomerOrdersReport;
12 use Magento\Mtf\Fixture\FixtureFactory;
13 use Magento\Mtf\TestCase\Injectable;
14 
30 class CustomersOrderCountReportEntityTest extends Injectable
31 {
32  /* tags */
33  const MVP = 'no';
34  const STABLE = 'no';
35  /* end tags */
36 
43 
50  public function __inject(CustomerOrdersReport $customerOrdersReport)
51  {
52  $this->customerOrdersReport = $customerOrdersReport;
53  }
54 
64  public function test(Customer $customer, $orders, array $report, FixtureFactory $fixtureFactory)
65  {
66  // Precondition
67  $customer->persist();
68  $orders = explode(',', $orders);
69  foreach ($orders as $order) {
70  $order = $fixtureFactory->createByCode(
71  'orderInjectable',
72  ['dataset' => $order, 'data' => ['customer_id' => ['customer' => $customer]]]
73  );
74  $order->persist();
75  }
76 
77  // Steps
78  $this->customerOrdersReport->open();
79  $this->customerOrdersReport->getFilterBlock()->viewsReport($report);
80  $this->customerOrdersReport->getFilterBlock()->refreshFilter();
81 
82  return['customer' => $customer];
83  }
84 }
$customer
Definition: customers.php:11
test(Customer $customer, $orders, array $report, FixtureFactory $fixtureFactory)
$order
Definition: order.php:55