You are here

public function FilterNumericTest::testFilterNumericExposedGroupedNotBetween in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/FilterNumericTest.php \Drupal\views\Tests\Handler\FilterNumericTest::testFilterNumericExposedGroupedNotBetween()

File

core/modules/views/src/Tests/Handler/FilterNumericTest.php, line 204
Contains \Drupal\views\Tests\Handler\FilterNumericTest.

Class

FilterNumericTest
Tests the numeric filter handler.

Namespace

Drupal\views\Tests\Handler

Code

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

  // Filter: Age, Operator: between, Value: 26 and 29
  $filters['age']['group_info']['default_group'] = 3;
  $view
    ->setDisplay('page_1');
  $view->displayHandlers
    ->get('page_1')
    ->overrideOption('filters', $filters);
  $view
    ->save();
  $this->container
    ->get('router.builder')
    ->rebuild();
  $this
    ->executeView($view);
  $resultset = array(
    array(
      'name' => 'John',
      'age' => 25,
    ),
    array(
      'name' => 'Paul',
      'age' => 26,
    ),
    array(
      'name' => 'Meredith',
      'age' => 30,
    ),
  );
  $this
    ->assertIdenticalResultset($view, $resultset, $this->columnMap);
}