function FilterDateTest::_testFilterDatetimeUI
Same name in other branches
- 9 core/modules/views/tests/src/Functional/Handler/FilterDateTest.php \Drupal\Tests\views\Functional\Handler\FilterDateTest::_testFilterDatetimeUI()
- 10 core/modules/views/tests/src/Functional/Handler/FilterDateTest.php \Drupal\Tests\views\Functional\Handler\FilterDateTest::_testFilterDatetimeUI()
- 11.x core/modules/views/tests/src/Functional/Handler/FilterDateTest.php \Drupal\Tests\views\Functional\Handler\FilterDateTest::_testFilterDatetimeUI()
Test datetime grouped filter UI.
1 call to FilterDateTest::_testFilterDatetimeUI()
- FilterDateTest::testDateFilter in core/
modules/ views/ tests/ src/ Functional/ Handler/ FilterDateTest.php - Runs other test methods.
File
-
core/
modules/ views/ tests/ src/ Functional/ Handler/ FilterDateTest.php, line 291
Class
- FilterDateTest
- Tests the core Drupal\views\Plugin\views\filter\Date handler.
Namespace
Drupal\Tests\views\Functional\HandlerCode
protected function _testFilterDatetimeUI() {
$this->drupalLogin($this->drupalCreateUser([
'administer views',
]));
$this->drupalPostForm('admin/structure/views/nojs/add-handler/test_filter_date_between/default/filter', [
'name[node__field_date.field_date_value]' => 'node__field_date.field_date_value',
], t('Add and configure filter criteria'));
$this->drupalPostForm(NULL, [], t('Expose filter'));
$this->drupalPostForm(NULL, [], t('Grouped filters'));
$edit = [];
$edit['options[group_info][group_items][1][title]'] = 'simple-offset';
$edit['options[group_info][group_items][1][operator]'] = '>';
$edit['options[group_info][group_items][1][value][type]'] = 'offset';
$edit['options[group_info][group_items][1][value][value]'] = '+1 hour';
$edit['options[group_info][group_items][2][title]'] = 'between-offset';
$edit['options[group_info][group_items][2][operator]'] = 'between';
$edit['options[group_info][group_items][2][value][type]'] = 'offset';
$edit['options[group_info][group_items][2][value][min]'] = '+1 hour';
$edit['options[group_info][group_items][2][value][max]'] = '+2 days';
$edit['options[group_info][group_items][3][title]'] = 'between-date';
$edit['options[group_info][group_items][3][operator]'] = 'between';
$edit['options[group_info][group_items][3][value][min]'] = $this->dateFormatter
->format(150000, 'custom', 'Y-m-d H:i:s');
$edit['options[group_info][group_items][3][value][max]'] = $this->dateFormatter
->format(250000, 'custom', 'Y-m-d H:i:s');
$this->drupalPostForm(NULL, $edit, t('Apply'));
$this->drupalPostForm('admin/structure/views/view/test_filter_date_between', [], t('Save'));
$this->assertConfigSchemaByName('views.view.test_filter_date_between');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.