1 views_plugin_style_mapping.test protected ViewsPluginStyleMappingTest::getBasicView()

Overrides ViewsTestCase::getBasicView().

Overrides ViewsSqlTest::getBasicView

File

core/modules/views/tests/styles/views_plugin_style_mapping.test, line 44
Definition of ViewsPluginStyleMappingTest.

Class

ViewsPluginStyleMappingTest
Tests the default/mapping row style.

Code

protected function getBasicView() {
  $view = parent::getBasicView();
  $view->display['default']->handler->override_option('style_plugin', 'test_mapping');
  $view->display['default']->handler->override_option('style_options', array(
    'mapping' => array(
      'name_field' => 'name',
      'numeric_field' => array(
        'age',
      ),
      'title_field' => 'name',
      'toggle_numeric_field' => TRUE,
      'toggle_title_field' => TRUE,
    ),
  ));
  $view->display['default']->handler->override_option('fields', array(
    'age' => array(
      'id' => 'age',
      'table' => 'views_test',
      'field' => 'age',
      'relationship' => 'none',
    ),
    'name' => array(
      'id' => 'name',
      'table' => 'views_test',
      'field' => 'name',
      'relationship' => 'none',
    ),
    'job' => array(
      'id' => 'job',
      'table' => 'views_test',
      'field' => 'job',
      'relationship' => 'none',
    ),
  ));
  return $view;
}