function FilterInOperatorTest::testFilterInOperatorGroupedExposedSimple

Same name and namespace in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::testFilterInOperatorGroupedExposedSimple()
  2. 10 core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::testFilterInOperatorGroupedExposedSimple()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php \Drupal\Tests\views\Kernel\Handler\FilterInOperatorTest::testFilterInOperatorGroupedExposedSimple()

File

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

Class

FilterInOperatorTest
Tests the core <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21filter%21InOperator.php/class/InOperator/9" 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

public function testFilterInOperatorGroupedExposedSimple() {
    $filters = $this->getGroupedExposedFilters();
    $view = Views::getView('test_view');
    // Filter: Age, Operator: in, Value: 26, 30
    $filters['age']['group_info']['default_group'] = 1;
    $view->setDisplay();
    $view->displayHandlers
        ->get('default')
        ->overrideOption('filters', $filters);
    $this->executeView($view);
    $expected_result = [
        [
            'name' => 'Paul',
            'age' => 26,
        ],
        [
            'name' => 'Meredith',
            'age' => 30,
        ],
    ];
    $this->assertCount(2, $view->result);
    $this->assertIdenticalResultset($view, $expected_result, $this->columnMap);
}

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