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