function ViewsHandlerManyToOneTest::getReducedExposedGroupedOptionsTestView

Generates test_reduced_exposed_grouped_options view.

1 call to ViewsHandlerManyToOneTest::getReducedExposedGroupedOptionsTestView()
ViewsHandlerManyToOneTest::testReducedExposedGroupedOptions in tests/handlers/views_handler_manytoone.test
Tests exposed filter with "Reduce duplicates." and grouped options.

File

tests/handlers/views_handler_manytoone.test, line 756

Class

ViewsHandlerManyToOneTest
Tests the many to one helper handler class.

Code

protected function getReducedExposedGroupedOptionsTestView() {
    $view = new view();
    $view->name = 'test_reduced_exposed_grouped_options';
    $view->description = '';
    $view->tag = 'default';
    $view->base_table = 'node';
    $view->human_name = 'test_reduced_exposed_grouped_options';
    $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['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';
    
    /* Field: Content: Title */
    $handler->display->display_options['fields']['title']['id'] = 'title';
    $handler->display->display_options['fields']['title']['table'] = 'node';
    $handler->display->display_options['fields']['title']['field'] = 'title';
    $handler->display->display_options['fields']['title']['label'] = '';
    $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
    $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
    
    /* Sort criterion: Content: Nid */
    $handler->display->display_options['sorts']['nid']['id'] = 'nid';
    $handler->display->display_options['sorts']['nid']['table'] = 'node';
    $handler->display->display_options['sorts']['nid']['field'] = 'nid';
    
    /* Filter criterion: Content: Published */
    $handler->display->display_options['filters']['status']['id'] = 'status';
    $handler->display->display_options['filters']['status']['table'] = 'node';
    $handler->display->display_options['filters']['status']['field'] = 'status';
    $handler->display->display_options['filters']['status']['value'] = 1;
    $handler->display->display_options['filters']['status']['group'] = 1;
    $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
    
    /* Filter criterion: Content: list (field_list) */
    $handler->display->display_options['filters']['field_list_value']['id'] = 'field_list_value';
    $handler->display->display_options['filters']['field_list_value']['table'] = 'field_data_field_list';
    $handler->display->display_options['filters']['field_list_value']['field'] = 'field_list_value';
    $handler->display->display_options['filters']['field_list_value']['exposed'] = TRUE;
    $handler->display->display_options['filters']['field_list_value']['expose']['operator_id'] = 'field_list_value_op';
    $handler->display->display_options['filters']['field_list_value']['expose']['label'] = 'list (field_list)';
    $handler->display->display_options['filters']['field_list_value']['expose']['operator'] = 'field_list_value_op';
    $handler->display->display_options['filters']['field_list_value']['expose']['identifier'] = 'field_list_value';
    $handler->display->display_options['filters']['field_list_value']['is_grouped'] = TRUE;
    $handler->display->display_options['filters']['field_list_value']['group_info']['label'] = 'list (field_list)';
    $handler->display->display_options['filters']['field_list_value']['group_info']['identifier'] = 'field_list_value';
    $handler->display->display_options['filters']['field_list_value']['group_info']['group_items'] = array(
        1 => array(
            'title' => 'Not 1 or 2',
            'operator' => 'not',
            'value' => array(
                1 => '1',
                2 => '2',
            ),
        ),
        2 => array(
            'title' => '1',
            'operator' => 'or',
            'value' => array(
                1 => '1',
            ),
        ),
        3 => array(
            'title' => '1 or 2',
            'operator' => 'or',
            'value' => array(
                1 => '1',
                2 => '2',
            ),
        ),
        4 => array(
            'title' => '1 and 2',
            'operator' => 'and',
            'value' => array(
                1 => '1',
                2 => '2',
            ),
        ),
        5 => array(
            'title' => 'empty',
            'operator' => 'empty',
            'value' => array(),
        ),
        6 => array(
            'title' => 'not empty',
            'operator' => 'not empty',
            'value' => array(),
        ),
    );
    return $view;
}