function ViewsQueryGroupByTest::viewsAggregateAmbiguityView

1 call to ViewsQueryGroupByTest::viewsAggregateAmbiguityView()
ViewsQueryGroupByTest::testAggregateAmbiguity in tests/views_groupby.test
Tests ambiguous group by column error (postgresql)

File

tests/views_groupby.test, line 48

Class

ViewsQueryGroupByTest
Tests aggregate functionality of views, for example count.

Code

public function viewsAggregateAmbiguityView() {
    $view = new view();
    $view->name = 'aggregate_ambiguity';
    $view->description = '';
    $view->tag = 'default';
    $view->base_table = 'node';
    $view->human_name = '';
    $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['use_more_always'] = FALSE;
    $handler->display->display_options['group_by'] = TRUE;
    $handler->display->display_options['access']['type'] = 'none';
    $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';
    
    /* Field: COUNT(Content revision: Nid) */
    $handler->display->display_options['fields']['nid']['id'] = 'nid';
    $handler->display->display_options['fields']['nid']['table'] = 'node_revision';
    $handler->display->display_options['fields']['nid']['field'] = 'nid';
    $handler->display->display_options['fields']['nid']['group_type'] = 'count';
    $handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0;
    $handler->display->display_options['fields']['nid']['alter']['make_link'] = 0;
    $handler->display->display_options['fields']['nid']['alter']['word_boundary'] = 1;
    $handler->display->display_options['fields']['nid']['alter']['ellipsis'] = 1;
    $handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0;
    $handler->display->display_options['fields']['nid']['alter']['trim'] = 0;
    $handler->display->display_options['fields']['nid']['alter']['html'] = 0;
    $handler->display->display_options['fields']['nid']['hide_empty'] = 0;
    $handler->display->display_options['fields']['nid']['empty_zero'] = 0;
    
    /* Field: Content: Nid */
    $handler->display->display_options['fields']['nid_1']['id'] = 'nid_1';
    $handler->display->display_options['fields']['nid_1']['table'] = 'node';
    $handler->display->display_options['fields']['nid_1']['field'] = 'nid';
    $handler->display->display_options['fields']['nid_1']['alter']['alter_text'] = 0;
    $handler->display->display_options['fields']['nid_1']['alter']['make_link'] = 0;
    $handler->display->display_options['fields']['nid_1']['alter']['word_boundary'] = 1;
    $handler->display->display_options['fields']['nid_1']['alter']['ellipsis'] = 1;
    $handler->display->display_options['fields']['nid_1']['alter']['strip_tags'] = 0;
    $handler->display->display_options['fields']['nid_1']['alter']['trim'] = 0;
    $handler->display->display_options['fields']['nid_1']['alter']['html'] = 0;
    $handler->display->display_options['fields']['nid_1']['hide_empty'] = 0;
    $handler->display->display_options['fields']['nid_1']['empty_zero'] = 0;
    
    /* Contextual filter: Content: Type */
    $handler->display->display_options['arguments']['type']['id'] = 'type';
    $handler->display->display_options['arguments']['type']['table'] = 'node';
    $handler->display->display_options['arguments']['type']['field'] = 'type';
    $handler->display->display_options['arguments']['type']['default_action'] = 'summary';
    $handler->display->display_options['arguments']['type']['default_argument_type'] = 'fixed';
    $handler->display->display_options['arguments']['type']['summary']['format'] = 'default_summary';
    return $view;
}