You are here

protected function FilterStringTest::getGroupedExposedFilters in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/FilterStringTest.php \Drupal\views\Tests\Handler\FilterStringTest::getGroupedExposedFilters()
12 calls to FilterStringTest::getGroupedExposedFilters()
FilterStringTest::testFilterStringGroupedExposedContains in core/modules/views/src/Tests/Handler/FilterStringTest.php
FilterStringTest::testFilterStringGroupedExposedEmpty in core/modules/views/src/Tests/Handler/FilterStringTest.php
FilterStringTest::testFilterStringGroupedExposedEnds in core/modules/views/src/Tests/Handler/FilterStringTest.php
FilterStringTest::testFilterStringGroupedExposedEqual in core/modules/views/src/Tests/Handler/FilterStringTest.php
FilterStringTest::testFilterStringGroupedExposedLonger in core/modules/views/src/Tests/Handler/FilterStringTest.php

... See full list

File

core/modules/views/src/Tests/Handler/FilterStringTest.php, line 761
Contains \Drupal\views\Tests\Handler\FilterStringTest.

Class

FilterStringTest
Tests the core Drupal\views\Plugin\views\filter\StringFilter handler.

Namespace

Drupal\views\Tests\Handler

Code

protected function getGroupedExposedFilters() {
  $filters = array(
    'name' => array(
      'id' => 'name',
      'plugin_id' => 'string',
      'table' => 'views_test_data',
      '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' => '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',
      'plugin_id' => 'string',
      'table' => 'views_test_data',
      '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;
}