Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractAssertCustomerOrderReportResult.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 abstract class AbstractAssertCustomerOrderReportResult extends AbstractConstraint
17 {
26  public function prepareFilter(Customer $customer, array $columns, array $report)
27  {
28  $format = '';
29  switch ($report['report_period']) {
30  case 'Day':
31  $format = 'M j, Y';
32  break;
33  case 'Month':
34  $format = 'j/Y';
35  break;
36  case 'Year':
37  $format = 'Y';
38  break;
39  }
40 
41  return [
42  'date' => date($format),
43  'customer' => $customer->getFirstname() . ' ' . $customer->getLastname(),
44  'orders' => $columns['orders'],
45  'average' => number_format($columns['average'], 2),
46  'total' => number_format($columns['total'], 2)
47  ];
48  }
49 }
$customer
Definition: customers.php:11
$columns
Definition: default.phtml:15
$format
Definition: list.phtml:12