You are here

function CommerceReportsViewsExportTestCase::testCustomerViewsDataExport in Commerce Reporting 7.4

File

src/Tests/CommerceReportsViewsExportTestCase.php, line 33

Class

CommerceReportsViewsExportTestCase
Class CommerceReportsViewsExportTestCase

Namespace

Drupal\commerce_reports\Tests

Code

function testCustomerViewsDataExport() {
  $this
    ->createCustomers(3);
  $this
    ->createProducts(2);
  $this
    ->createOrders(10);
  $customers = $this
    ->createdCustomersData();
  $rendered = $this
    ->getRenderedExport('commerce_reports_customers');
  $this
    ->assertCsvHeaders('"Customer","Orders","Total","Average"', $rendered[0]);
  array_shift($rendered);
  $this
    ->assertEqual(count($rendered), count($customers), t('The amount of customers (%reported) that is reported (%generated) upon is correct.', array(
    '%reported' => count($rendered),
    '%generated' => count($customers),
  )));
}