function ExposedFormTest::testRememberSelected

Same name in other branches
  1. 10 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::testRememberSelected()
  2. 11.x 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 516

Class

ExposedFormTest
Tests exposed forms functionality.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

public function testRememberSelected() {
    $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.