function ExposedFormTest::testRememberSelected

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::testRememberSelected()
  2. 10 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::testRememberSelected()

Tests the "Remember the last selection" functionality.

File

core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php, line 551

Class

ExposedFormTest
Tests exposed forms functionality.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testRememberSelected() : void {
    $this->drupalGet('test_remember_selected');
    $this->getSession()
        ->getPage()
        ->fillField('type', 'page');
    $this->getSession()
        ->getPage()
        ->pressButton('Apply');
    // Reload the page and ensure the filter is selected.
    $this->drupalGet('test_remember_selected');
    $this->assertTrue($this->assertSession()
        ->optionExists('type', 'page')
        ->isSelected());
}

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