function FilterDateTest::testExposedFilter

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/Handler/FilterDateTest.php \Drupal\Tests\views\Functional\Handler\FilterDateTest::testExposedFilter()
  2. 8.9.x core/modules/views/tests/src/Functional/Handler/FilterDateTest.php \Drupal\Tests\views\Functional\Handler\FilterDateTest::testExposedFilter()
  3. 10 core/modules/views/tests/src/Functional/Handler/FilterDateTest.php \Drupal\Tests\views\Functional\Handler\FilterDateTest::testExposedFilter()

Tests that the exposed date filter is displayed without errors.

File

core/modules/views/tests/src/Functional/Handler/FilterDateTest.php, line 344

Class

FilterDateTest
Tests the core Drupal\views\Plugin\views\filter\Date handler.

Namespace

Drupal\Tests\views\Functional\Handler

Code

public function testExposedFilter() : void {
    $this->drupalLogin($this->drupalCreateUser([
        'administer views',
    ]));
    $this->drupalGet('admin/structure/views/nojs/handler/test_filter_date_between/default/filter/created');
    $this->submitForm([], 'Expose filter');
    $this->drupalGet('admin/structure/views/view/test_filter_date_between/edit');
    $this->submitForm([], 'Add Page');
    $edit = [
        'path' => 'exposed-date-filter',
    ];
    $this->drupalGet('admin/structure/views/nojs/display/test_filter_date_between/page_1/path');
    $this->submitForm($edit, 'Apply');
    $this->submitForm([], 'Save');
    $this->drupalGet('exposed-date-filter');
    $this->assertSession()
        ->fieldExists('created');
}

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