Skip to content
Snippets Groups Projects
Commit 68859414 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1645156 follow-up by attiks: More robust handling of HTTP_HOST override in test.

parent eae31f1d
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,8 @@ function testDomainNameNegotiationPort() {
drupal_static_reset('language_url_outbound_alter');
drupal_static_reset('language_url_rewrite_url');
// Remember current HTTP_HOST.
$http_host = $_SERVER['HTTP_HOST'];
// Fake a different port.
$_SERVER['HTTP_HOST'] .= ':88';
......@@ -107,6 +109,9 @@ function testDomainNameNegotiationPort() {
$url = url('', array('absolute' => TRUE, 'language' => $language));
$this->assertTrue(strcmp($url, 'http://example.fr:88/') == 0, 'The right port is used.');
// Restore HTTP_HOST.
$_SERVER['HTTP_HOST'] = $http_host;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment