function FilterInOperatorTest::getGroupedExposedFilters

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::getGroupedExposedFilters()
  2. 10 core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::getGroupedExposedFilters()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::getGroupedExposedFilters()
3 calls to FilterInOperatorTest::getGroupedExposedFilters()
FilterInOperatorTest::testFilterGroupedChangedIdentifier in core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php
Tests that we can safely change the identifier on a grouped filter.
FilterInOperatorTest::testFilterInOperatorGroupedExposedSimple in core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php
FilterInOperatorTest::testFilterNotInOperatorGroupedExposedSimple in core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php

File

core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php, line 200

Class

FilterInOperatorTest
Tests the core Drupal\views\Plugin\views\filter\InOperator handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

protected function getGroupedExposedFilters() {
    $filters = [
        'age' => [
            'id' => 'age',
            'table' => 'views_test_data',
            'field' => 'age',
            'relationship' => 'none',
            'exposed' => TRUE,
            'expose' => [
                'operator' => 'age_op',
                'label' => 'age',
                'identifier' => 'age',
            ],
            'is_grouped' => TRUE,
            'group_info' => [
                'label' => 'age',
                'identifier' => 'age',
                'default_group' => 'All',
                'group_items' => [
                    1 => [
                        'title' => 'Age is one of 26, 30',
                        'operator' => 'in',
                        'value' => [
                            26,
                            30,
                        ],
                    ],
                    2 => [
                        'title' => 'Age is not one of 26, 30',
                        'operator' => 'not in',
                        'value' => [
                            26,
                            30,
                        ],
                    ],
                ],
            ],
        ],
    ];
    return $filters;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.