public function FilterInOperatorTest::testFilterInOperatorGroupedExposedSimple in Views (for Drupal 7) 8.3
File
- lib/
Drupal/ views/ Tests/ Handler/ FilterInOperatorTest.php, line 106 - Definition of Drupal\views\Tests\Handler\FilterInOperatorTest.
Class
- FilterInOperatorTest
- Tests the core Drupal\views\Plugin\views\filter\InOperator handler.
Namespace
Drupal\views\Tests\HandlerCode
public function testFilterInOperatorGroupedExposedSimple() {
$filters = $this
->getGroupedExposedFilters();
$view = $this
->getBasicPageView();
// Filter: Age, Operator: in, Value: 26, 30
$filters['age']['group_info']['default_group'] = 1;
$view
->setDisplay('page_1');
$view->displayHandlers['page_1']
->overrideOption('filters', $filters);
$this
->executeView($view);
$expected_result = array(
array(
'name' => 'Paul',
'age' => 26,
),
array(
'name' => 'Meredith',
'age' => 30,
),
);
$this
->assertEqual(2, count($view->result));
$this
->assertIdenticalResultset($view, $expected_result, array(
'views_test_data_name' => 'name',
'views_test_data_age' => 'age',
));
}