function ExposedFormTest::testExposedFilterPagination
Same name in other branches
- 9 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::testExposedFilterPagination()
- 10 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::testExposedFilterPagination()
- 11.x core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::testExposedFilterPagination()
Tests the exposed form with a pager.
File
-
core/
modules/ views/ tests/ src/ Functional/ Plugin/ ExposedFormTest.php, line 413
Class
- ExposedFormTest
- Tests exposed forms functionality.
Namespace
Drupal\Tests\views\Functional\PluginCode
public function testExposedFilterPagination() {
$this->drupalCreateContentType([
'type' => 'post',
]);
// Create some random nodes.
for ($i = 0; $i < 5; $i++) {
$this->drupalCreateNode([
'type' => 'post',
]);
}
$this->drupalGet('test_exposed_form_pager');
$this->getSession()
->getPage()
->fillField('type[]', 'post');
$this->getSession()
->getPage()
->fillField('created[min]', '-1 month');
$this->getSession()
->getPage()
->fillField('created[max]', '+1 month');
// Ensure the filters can be applied.
$this->getSession()
->getPage()
->pressButton('Apply');
$this->assertFieldByName('type[]', 'post');
$this->assertFieldByName('created[min]', '-1 month');
$this->assertFieldByName('created[max]', '+1 month');
// Ensure the filters are still applied after pressing next.
$this->clickLink('Next ›');
$this->assertFieldByName('type[]', 'post');
$this->assertFieldByName('created[min]', '-1 month');
$this->assertFieldByName('created[max]', '+1 month');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.