function FilterTest::testInOperatorSelectAllOptions

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::testInOperatorSelectAllOptions()
  2. 10 core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::testInOperatorSelectAllOptions()
  3. 11.x core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::testInOperatorSelectAllOptions()

Tests an exposed filter when all options are selected.

File

core/modules/views/tests/src/Functional/Plugin/FilterTest.php, line 158

Class

FilterTest
Tests general filter plugin functionality.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testInOperatorSelectAllOptions() {
    $row['row[type]'] = 'fields';
    $this->drupalGet('admin/structure/views/nojs/display/test_filter_in_operator_ui/default/row');
    $this->submitForm($row, 'Apply');
    $field['name[node_field_data.nid]'] = TRUE;
    $this->drupalGet('admin/structure/views/nojs/add-handler/test_filter_in_operator_ui/default/field');
    $this->submitForm($field, 'Add and configure fields');
    $this->drupalGet('admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/field/nid');
    $this->submitForm([], 'Apply');
    $edit['options[value][all]'] = TRUE;
    $edit['options[value][article]'] = TRUE;
    $edit['options[value][page]'] = TRUE;
    $this->drupalGet('admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type');
    $this->submitForm($edit, 'Apply');
    $this->drupalGet('admin/structure/views/view/test_filter_in_operator_ui/edit/default');
    $this->submitForm([], 'Save');
    $this->submitForm([], 'Update preview');
    $this->assertSession()
        ->pageTextNotContains('An illegal choice has been detected.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.