protected function HttpResponseHeadersUITestCase::createHeaderRule in HTTP Response Headers 7
Helper to create new header rule.
Parameters
string $machine_name: A string rule ID.
string $name: A string name.
string $header: A string header.
mixed $header_value: Header value
array $visibility_options: An array of visibility options.
Return value
string A string rule ID created.
4 calls to HttpResponseHeadersUITestCase::createHeaderRule()
- HttpResponseHeadersUITestCase::testHeaderRuleAdminUI in modules/
http_response_headers_ui/ http_response_headers_ui.test - Test creating header rule.
- HttpResponseHeadersUITestCase::testHeaderRuleHelpers in modules/
http_response_headers_ui/ http_response_headers_ui.test - Test header rule helpers that changes the user input.
- HttpResponseHeadersUITestCase::testHeaderRuleVisibility in modules/
http_response_headers_ui/ http_response_headers_ui.test - Test header rule visibility.
- HttpResponseHeadersUITestCase::testHeaderRuleVisibilityListedEmpty in modules/
http_response_headers_ui/ http_response_headers_ui.test - Test header rule with empty "pages" textarea.
File
- modules/
http_response_headers_ui/ http_response_headers_ui.test, line 251 - Tests for http_response_headers_ui.module.
Class
- HttpResponseHeadersUITestCase
- @file Tests for http_response_headers_ui.module.
Code
protected function createHeaderRule($machine_name, $name, $header, $header_value, $visibility_options = array()) {
$header_rule['description'] = $name;
$header_rule['machine_name'] = $machine_name;
$header_rule['header'] = $header;
$header_rule['header_value'] = $header_value;
$header_rule += $visibility_options;
$this
->drupalPost('admin/config/system/http-response-headers/add', $header_rule, t('Save'));
return $machine_name;
}