function FilterNumericTest::testFilterNumericBetween
Same name in other branches
- 8.9.x core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php \Drupal\Tests\views\Kernel\Handler\FilterNumericTest::testFilterNumericBetween()
- 10 core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php \Drupal\Tests\views\Kernel\Handler\FilterNumericTest::testFilterNumericBetween()
- 11.x core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php \Drupal\Tests\views\Kernel\Handler\FilterNumericTest::testFilterNumericBetween()
Tests the between operator.
@dataProvider providerTestFilterNumericBetween
Parameters
string $operator: The operator to test ('between' or 'not between').
string $min: The min value.
string $max: The max value.
array $expected_result: The expected results.
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ FilterNumericTest.php, line 103
Class
- FilterNumericTest
- Tests the numeric filter handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function testFilterNumericBetween($operator, $min, $max, array $expected_result) {
$view = Views::getView('test_view');
$view->setDisplay();
$view->displayHandlers
->get('default')
->overrideOption('filters', [
'age' => [
'id' => 'age',
'table' => 'views_test_data',
'field' => 'age',
'relationship' => 'none',
'operator' => $operator,
'value' => [
'min' => $min,
'max' => $max,
],
],
]);
$this->executeView($view);
$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.