You are here

protected function ViewsDataExportBaseTest::viewsData in Views data export 7.4

Same name and namespace in other branches
  1. 7.3 tests/base.test \ViewsDataExportBaseTest::viewsData()

The views data definition.

1 call to ViewsDataExportBaseTest::viewsData()
ViewsDataExportBaseTest::setUp in tests/base.test
Sets up a Drupal site for running functional and integration tests.

File

tests/base.test, line 103

Class

ViewsDataExportBaseTest

Code

protected function viewsData() {

  // Declaration of the base table.
  $data['views_test']['table'] = array(
    'group' => t('Views test'),
    'base' => array(
      'field' => 'id',
      'title' => t('Views test'),
      'help' => t('Users who have created accounts on your site.'),
    ),
  );

  // Declaration of fields.
  $data['views_test']['id'] = array(
    'title' => t('ID'),
    'help' => t('The test data ID'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['name'] = array(
    'title' => t('Name'),
    'help' => t('The name of the person'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['age'] = array(
    'title' => t('Age'),
    'help' => t('The age of the person'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['job'] = array(
    'title' => t('Job'),
    'help' => t('The job of the person'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['created'] = array(
    'title' => t('Created'),
    'help' => t('The creation date of this record'),
    'field' => array(
      'handler' => 'views_handler_field_date',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_date',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_date',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort_date',
    ),
  );
  return $data;
}