You are here

protected function FilterNumericTest::getGroupedExposedFilters in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php \Drupal\Tests\views\Kernel\Handler\FilterNumericTest::getGroupedExposedFilters()
  2. 10 core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php \Drupal\Tests\views\Kernel\Handler\FilterNumericTest::getGroupedExposedFilters()
6 calls to FilterNumericTest::getGroupedExposedFilters()
FilterNumericTest::testFilterNumericExposedGroupedBetween in core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
FilterNumericTest::testFilterNumericExposedGroupedEmpty in core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
FilterNumericTest::testFilterNumericExposedGroupedNotBetween in core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
FilterNumericTest::testFilterNumericExposedGroupedNotEmpty in core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
FilterNumericTest::testFilterNumericExposedGroupedRegularExpression in core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
Tests the numeric filter handler with the 'regular_expression' operator to grouped exposed filters.

... See full list

File

core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php, line 448

Class

FilterNumericTest
Tests the numeric filter handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

protected function getGroupedExposedFilters() {
  $filters = [
    'age' => [
      'id' => 'age',
      'plugin_id' => 'numeric',
      '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 28',
            'operator' => '=',
            'value' => [
              'value' => 28,
            ],
          ],
          2 => [
            'title' => 'Age is between 26 and 29',
            'operator' => 'between',
            'value' => [
              'min' => 26,
              'max' => 29,
            ],
          ],
          3 => [
            'title' => 'Age is not between 26 and 29',
            'operator' => 'not between',
            'value' => [
              'min' => 26,
              'max' => 29,
            ],
          ],
          4 => [
            'title' => 'Age is empty',
            'operator' => 'empty',
          ],
          5 => [
            'title' => 'Age is not empty',
            'operator' => 'not empty',
          ],
          6 => [
            'title' => 'Age is regexp 2[7-8]',
            'operator' => 'regular_expression',
            'value' => [
              'value' => '2[7-8]',
            ],
          ],
        ],
      ],
    ],
  ];
  return $filters;
}