function ViewsPluginStyleMappingTest::getBasicView

Overrides ViewsTestCase::getBasicView().

Overrides ViewsSqlTest::getBasicView

1 call to ViewsPluginStyleMappingTest::getBasicView()
ViewsPluginStyleMappingTest::testMappedOutput in tests/styles/views_plugin_style_mapping.test
Verifies that the fields were mapped correctly.

File

tests/styles/views_plugin_style_mapping.test, line 61

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;
}