You are here

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

Generates test_oneof view.

1 call to ViewsHandlerManyToOneTest::getGroupedOneOfTestView()
ViewsHandlerManyToOneTest::testGroupedOneOf in tests/handlers/views_handler_manytoone.test
Tests duplicate grouped "one of" filters on taxonomy term field.

File

tests/handlers/views_handler_manytoone.test, line 691

Class

ViewsHandlerManyToOneTest
Tests the many to one helper handler class.

Code

protected function getGroupedOneOfTestView() {
  $view = new view();
  $view->name = 'test_oneof';
  $view->description = '';
  $view->tag = 'default';
  $view->base_table = 'node';
  $view->human_name = 'test_oneof';
  $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';
  $handler->display->display_options['filter_groups']['operator'] = 'OR';
  $handler->display->display_options['filter_groups']['groups'] = array(
    1 => 'AND',
    2 => 'AND',
  );

  /* 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',
  );
  $handler->display->display_options['filters']['field_tags_tid']['group'] = 2;
  $handler->display->display_options['filters']['field_tags_tid']['reduce_duplicates'] = TRUE;
  $handler->display->display_options['filters']['field_tags_tid']['type'] = 'select';
  $handler->display->display_options['filters']['field_tags_tid']['vocabulary'] = 'tags';

  /* Filter criterion: Content: Tags (field_tags) */
  $handler->display->display_options['filters']['field_tags_tid_1']['id'] = 'field_tags_tid_1';
  $handler->display->display_options['filters']['field_tags_tid_1']['table'] = 'field_data_field_tags';
  $handler->display->display_options['filters']['field_tags_tid_1']['field'] = 'field_tags_tid';
  $handler->display->display_options['filters']['field_tags_tid_1']['value'] = array(
    1 => '1',
  );
  $handler->display->display_options['filters']['field_tags_tid_1']['reduce_duplicates'] = TRUE;
  $handler->display->display_options['filters']['field_tags_tid_1']['type'] = 'select';
  $handler->display->display_options['filters']['field_tags_tid_1']['vocabulary'] = 'tags';
  return $view;
}