function FilterTest::testInOperatorSelectAllOptions

Same name and namespace in other branches
  1. 9 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()

Test 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() {
    $view = Views::getView('test_filter_in_operator_ui');
    $row['row[type]'] = 'fields';
    $this->drupalPostForm('admin/structure/views/nojs/display/test_filter_in_operator_ui/default/row', $row, t('Apply'));
    $field['name[node_field_data.nid]'] = TRUE;
    $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_filter_in_operator_ui/default/field', $field, t('Add and configure fields'));
    $this->drupalPostForm('admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/field/nid', [], t('Apply'));
    $edit['options[value][all]'] = TRUE;
    $edit['options[value][article]'] = TRUE;
    $edit['options[value][page]'] = TRUE;
    $this->drupalPostForm('admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type', $edit, t('Apply'));
    $this->drupalPostForm('admin/structure/views/view/test_filter_in_operator_ui/edit/default', [], t('Save'));
    $this->drupalPostForm(NULL, [], t('Update preview'));
    $this->assertNoText('An illegal choice has been detected.');
}

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