You are here

protected function FilterDateTest::_testUiValidation in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/FilterDateTest.php \Drupal\views\Tests\Handler\FilterDateTest::_testUiValidation()

Make sure the validation callbacks works.

1 call to FilterDateTest::_testUiValidation()
FilterDateTest::testDateFilter in core/modules/views/src/Tests/Handler/FilterDateTest.php
Runs other test methods.

File

core/modules/views/src/Tests/Handler/FilterDateTest.php, line 147
Contains \Drupal\views\Tests\Handler\FilterDateTest.

Class

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

Namespace

Drupal\views\Tests\Handler

Code

protected function _testUiValidation() {
  $this
    ->drupalLogin($this
    ->drupalCreateUser(array(
    'administer views',
    'administer site configuration',
  )));
  $this
    ->drupalGet('admin/structure/views/view/test_filter_date_between/edit');
  $this
    ->drupalGet('admin/structure/views/nojs/handler/test_filter_date_between/default/filter/created');
  $edit = array();

  // Generate a definitive wrong value, which should be checked by validation.
  $edit['options[value][value]'] = $this
    ->randomString() . '-------';
  $this
    ->drupalPostForm(NULL, $edit, t('Apply'));
  $this
    ->assertText(t('Invalid date format.'), 'Make sure that validation is run and the invalidate date format is identified.');
}