You are here

protected function ViewsHandlerManyToOneTest::getTermIdExposedGroupedOptionsTestView in Views (for Drupal 7) 7.3

Generates test_tid_exposed_grouped_options view.

1 call to ViewsHandlerManyToOneTest::getTermIdExposedGroupedOptionsTestView()
ViewsHandlerManyToOneTest::testTermIdExposedGroupedOptions in tests/handlers/views_handler_manytoone.test
Tests exposed filter on term ID with grouped options.

File

tests/handlers/views_handler_manytoone.test, line 855

Class

ViewsHandlerManyToOneTest
Tests the many to one helper handler class.

Code

protected function getTermIdExposedGroupedOptionsTestView() {
  $view = new view();
  $view->name = 'test_tid_exposed_grouped_options';
  $view->description = '';
  $view->tag = 'default';
  $view->base_table = 'node';
  $view->human_name = 'test_tid_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: Tags (field_tags) */
  $handler->display->display_options['filters']['field_tags_tid']['id'] = 'field_tags_tid';
  $handler->display->display_options['filters']['field_tags_tid']['table'] = 'field_data_field_tags';
  $handler->display->display_options['filters']['field_tags_tid']['field'] = 'field_tags_tid';
  $handler->display->display_options['filters']['field_tags_tid']['value'] = array(
    1 => '1',
    2 => '2',
  );
  $handler->display->display_options['filters']['field_tags_tid']['exposed'] = TRUE;
  $handler->display->display_options['filters']['field_tags_tid']['expose']['operator_id'] = 'field_tags_tid_op';
  $handler->display->display_options['filters']['field_tags_tid']['expose']['label'] = 'Tags (field_tags)';
  $handler->display->display_options['filters']['field_tags_tid']['expose']['operator'] = 'field_tags_tid_op';
  $handler->display->display_options['filters']['field_tags_tid']['expose']['identifier'] = 'field_tags_tid';
  $handler->display->display_options['filters']['field_tags_tid']['expose']['remember_roles'] = array(
    2 => '2',
  );
  $handler->display->display_options['filters']['field_tags_tid']['is_grouped'] = TRUE;
  $handler->display->display_options['filters']['field_tags_tid']['group_info']['label'] = 'Tags (field_tags)';
  $handler->display->display_options['filters']['field_tags_tid']['group_info']['identifier'] = 'field_tags_tid';
  $handler->display->display_options['filters']['field_tags_tid']['group_info']['group_items'] = array(
    1 => array(
      'title' => 'Is none of 2',
      'operator' => 'not',
      'value' => array(
        2 => '2',
      ),
    ),
    2 => array(
      'title' => 'Is none of 1 or 2',
      'operator' => 'not',
      'value' => array(
        1 => '1',
        2 => '2',
      ),
    ),
    3 => array(
      'title' => 'Is one of 1',
      'operator' => 'or',
      'value' => array(
        1 => '1',
      ),
    ),
    4 => array(
      'title' => 'Is one of 1 or 2',
      'operator' => 'or',
      'value' => array(
        1 => '1',
        2 => '2',
      ),
    ),
    5 => array(
      'title' => 'Is all of 1 and 2',
      'operator' => 'and',
      'value' => array(
        1 => '1',
        2 => '2',
      ),
    ),
    6 => array(
      'title' => 'Is empty',
      'operator' => 'empty',
      'value' => array(
        1 => '1',
        2 => '2',
      ),
    ),
    7 => array(
      'title' => 'Is not empty',
      'operator' => 'not empty',
      'value' => array(
        1 => '1',
        2 => '2',
      ),
    ),
  );
  $handler->display->display_options['filters']['field_tags_tid']['type'] = 'select';
  $handler->display->display_options['filters']['field_tags_tid']['vocabulary'] = 'tags';
  return $view;
}