function viewsHandlerFieldFieldTest::getFieldView

3 calls to viewsHandlerFieldFieldTest::getFieldView()
viewsHandlerFieldFieldTest::_testFormatterSimpleFieldRender in tests/field/views_fieldapi.test
Tests that fields with formatters runs as expected.
viewsHandlerFieldFieldTest::_testMultipleFieldRender in tests/field/views_fieldapi.test
viewsHandlerFieldFieldTest::_testSimpleFieldRender in tests/field/views_fieldapi.test

File

tests/field/views_fieldapi.test, line 495

Class

viewsHandlerFieldFieldTest
Tests the field_field handler.

Code

protected function getFieldView() {
    $view = new view();
    $view->name = 'view_fieldapi';
    $view->description = '';
    $view->tag = 'default';
    $view->base_table = 'node';
    $view->human_name = 'view_fieldapi';
    $view->core = 7;
    $view->api_version = '3.0';
    $view->disabled = FALSE;
    
    /* Edit this to true to make a default view disabled initially */
    
    /* Display: Master */
    $handler = $view->new_display('default', 'Master', 'default');
    $handler->display->display_options['access']['type'] = 'perm';
    $handler->display->display_options['cache']['type'] = 'none';
    $handler->display->display_options['query']['type'] = 'views_query';
    $handler->display->display_options['exposed_form']['type'] = 'basic';
    $handler->display->display_options['pager']['type'] = 'full';
    $handler->display->display_options['style_plugin'] = 'default';
    $handler->display->display_options['row_plugin'] = 'fields';
    $handler->display->display_options['fields']['nid']['id'] = 'nid';
    $handler->display->display_options['fields']['nid']['table'] = 'node';
    $handler->display->display_options['fields']['nid']['field'] = 'nid';
    foreach ($this->fields as $field) {
        $handler->display->display_options['fields'][$field['field_name']]['id'] = $field['field_name'];
        $handler->display->display_options['fields'][$field['field_name']]['table'] = 'field_data_' . $field['field_name'];
        $handler->display->display_options['fields'][$field['field_name']]['field'] = $field['field_name'];
    }
    return $view;
}