You are here

public function FilterNumericTest::testFilterNumericSimple 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::testFilterNumericSimple()

File

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

Class

FilterNumericTest
Tests the numeric filter handler.

Namespace

Drupal\views\Tests\Handler

Code

public function testFilterNumericSimple() {
  $view = Views::getView('test_view');
  $view
    ->setDisplay();

  // Change the filtering
  $view->displayHandlers
    ->get('default')
    ->overrideOption('filters', array(
    'age' => array(
      'id' => 'age',
      'table' => 'views_test_data',
      'field' => 'age',
      'relationship' => 'none',
      'operator' => '=',
      'value' => array(
        'value' => 28,
      ),
    ),
  ));
  $this
    ->executeView($view);
  $resultset = array(
    array(
      'name' => 'Ringo',
      'age' => 28,
    ),
  );
  $this
    ->assertIdenticalResultset($view, $resultset, $this->columnMap);
}