1 views_handler_filter_string.test protected ViewsHandlerFilterStringTest::getGroupedExposedFilters()

File

core/modules/views/tests/handlers/views_handler_filter_string.test, line 697
Definition of ViewsHandlerFilterStringTest.

Class

ViewsHandlerFilterStringTest
Tests the core views_handler_filter_string handler.

Code

protected function getGroupedExposedFilters() {
  $filters = array(
    'name' => array(
      'id' => 'name',
      'table' => 'views_test',
      'field' => 'name',
      'relationship' => 'none',
      'exposed' => TRUE,
      'expose' => array(
        'operator' => 'name_op',
        'label' => 'name',
        'identifier' => 'name',
      ),
      'is_grouped' => TRUE,
      'group_info' => array(
        'label' => 'name',
        'identifier' => 'name',
        'default_group' => 'All',
        'group_items' => array(
          1 => array(
            'title' => 'Is Ringo',
            'operator' => '=',
            'value' => 'Ringo',
          ),
          2 => array(
            'title' => 'Is not Ringo',
            'operator' => '!=',
            'value' => array('value' => 'Ringo'),
          ),
          3 => array(
            'title' => 'Contains ing',
            'operator' => 'contains',
            'value' => 'ing',
          ),
          4 => array(
            'title' => 'Shorter than 5 letters',
            'operator' => 'shorterthan',
            'value' => 5,
          ),
          5 => array(
            'title' => 'Longer than 7 letters',
            'operator' => 'longerthan',
            'value' => 7,
          ),
        ),
      ),
    ),
    'description' => array(
      'id' => 'description',
      'table' => 'views_test',
      'field' => 'description',
      'relationship' => 'none',
      'exposed' => TRUE,
      'expose' => array(
        'operator' => 'description_op',
        'label' => 'description',
        'identifier' => 'description',
      ),
      'is_grouped' => TRUE,
      'group_info' => array(
        'label' => 'description',
        'identifier' => 'description',
        'default_group' => 'All',
        'group_items' => array(
          1 => array(
            'title' => 'Contains the word: Actor',
            'operator' => 'word',
            'value' => 'actor',
          ),
          2 => array(
            'title' => 'Starts with George',
            'operator' => 'starts',
            'value' => 'George',
          ),
          3 => array(
            'title' => 'Not Starts with: George',
            'operator' => 'not_starts',
            'value' => 'George',
          ),
          4 => array(
            'title' => 'Ends with: Beatles',
            'operator' => 'ends',
            'value' => 'Beatles.',
          ),
          5 => array(
            'title' => 'Not Ends with: Beatles',
            'operator' => 'not_ends',
            'value' => 'Beatles.',
          ),
          6 => array(
            'title' => 'Does not contain: Beatles',
            'operator' => 'not',
            'value' => 'Beatles.',
          ),
          7 => array(
            'title' => 'Empty description',
            'operator' => 'empty',
            'value' => '',
          ),
        ),
      ),
    ),
  );
  return $filters;
}