You are here

public function FilterTest::testInOperatorSelectAllOptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::testInOperatorSelectAllOptions()

Tests no error message is displayed when all options are selected in an exposed filter.

File

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

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.');
}