function FilterDateTest::testExposedFilter

Tests that the exposed date filter is displayed without errors.

File

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

Class

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

Namespace

Drupal\Tests\views\Functional\Handler

Code

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

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