Commit 68859414 authored by webchick's avatar webchick

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

parent eae31f1d
......@@ -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;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment