function FilterInOperatorTest::getGroupedExposedFilters

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::getGroupedExposedFilters()
  2. 8.9.x core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::getGroupedExposedFilters()
  3. 10 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 202

Class

FilterInOperatorTest
Tests the core <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21filter%21InOperator.php/class/InOperator/11.x" title="Simple filter to handle matching of multiple options selectable via checkboxes." class="local">Drupal\views\Plugin\views\filter\InOperator</a> 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.