protected function BEF_TestBase::addField in Better Exposed Filters 7.3
Adds a field to a view display. See addFilter for parameter options.
Note: This routine expects the caller to save the view, as needed.
File
- tests/
better_exposed_filters_TestBase.php, line 232 - Base class for testing the Better Exposed Filters module. @author mikeker
Class
- BEF_TestBase
- Helper functions for Better Exposed Filters tests.
Code
protected function addField($field, $settings = array(), $display = 'default') {
$edit = array(
"name[{$field}]" => TRUE,
);
$url = 'admin/structure/views/nojs/add-item/' . $this->view['machine_name'] . "/{$display}/field";
$this
->drupalPost($url, $edit, 'Add and configure fields');
$this
->drupalPost(NULL, $settings, 'Apply');
}