public function FilterUITest::testFilterInOperatorUi in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views_ui/tests/src/Functional/FilterUITest.php \Drupal\Tests\views_ui\Functional\FilterUITest::testFilterInOperatorUi()
- 9 core/modules/views_ui/tests/src/Functional/FilterUITest.php \Drupal\Tests\views_ui\Functional\FilterUITest::testFilterInOperatorUi()
Tests that an option for a filter is saved as expected from the UI.
File
- core/
modules/ views_ui/ tests/ src/ Functional/ FilterUITest.php, line 43
Class
- FilterUITest
- Tests for the filters from the UI.
Namespace
Drupal\Tests\views_ui\FunctionalCode
public function testFilterInOperatorUi() {
$admin_user = $this
->drupalCreateUser([
'administer views',
'administer site configuration',
]);
$this
->drupalLogin($admin_user);
$path = 'admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type';
$this
->drupalGet($path);
// Verifies that "Limit list to selected items" option is not selected.
$this
->assertSession()
->fieldValueEquals('options[expose][reduce]', FALSE);
// Select "Limit list to selected items" option and apply.
$edit = [
'options[expose][reduce]' => TRUE,
];
$this
->drupalGet($path);
$this
->submitForm($edit, 'Apply');
// Verifies that the option was saved as expected.
$this
->drupalGet($path);
$this
->assertSession()
->fieldValueEquals('options[expose][reduce]', TRUE);
}