You are here

public function FilterNumericTest::testFilterNumericExposedGroupedSimple 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::testFilterNumericExposedGroupedSimple()
  2. 10 core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php \Drupal\Tests\views\Kernel\Handler\FilterNumericTest::testFilterNumericExposedGroupedSimple()

File

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

Class

FilterNumericTest
Tests the numeric filter handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testFilterNumericExposedGroupedSimple() {
  $filters = $this
    ->getGroupedExposedFilters();
  $view = Views::getView('test_view');
  $view
    ->newDisplay('page', 'Page', 'page_1');

  // Filter: Age, Operator: =, Value: 28
  $filters['age']['group_info']['default_group'] = 1;
  $view
    ->setDisplay('page_1');
  $view->displayHandlers
    ->get('page_1')
    ->overrideOption('filters', $filters);
  $view
    ->save();
  $this
    ->executeView($view);
  $resultset = [
    [
      'name' => 'Ringo',
      'age' => 28,
    ],
  ];
  $this
    ->assertIdenticalResultset($view, $resultset, $this->columnMap);
}