From cab259ab955456833c94ee6655db0f141894f6fb Mon Sep 17 00:00:00 2001 From: webchick Date: Tue, 28 Feb 2012 23:56:59 -0800 Subject: =?UTF-8?q?Issue=20#673020=20by=20Zolt=C3=A1n=20Balogh,=20attiks,?= =?UTF-8?q?=20mgifford,=20G=C3=A1bor=20Hojtsy,=20e2thex,=20good=5Fman,=20k?= =?UTF-8?q?alman.hosszu=20|=20Fleshgrinder:=20Fixed=20Tests=20for=20adding?= =?UTF-8?q?=20the=20Content-Language=20HTTP=20header=20to=20the=20generate?= =?UTF-8?q?d=20page.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/simpletest/tests/common.test | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index b3fc849a3..5ce0d95cd 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -938,7 +938,7 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase { } function setUp() { - parent::setUp('system_test'); + parent::setUp('system_test', 'locale'); } function testDrupalHTTPRequest() { @@ -1035,6 +1035,22 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase { $multiple_redirect_3 = drupal_http_request(url('system-test/multiple-redirects/3', array('absolute' => TRUE)), array('max_redirects' => 3)); $this->assertEqual($multiple_redirect_3->redirect_url, $multiple_redirect_final_url, t('redirect_url contains the final redirection location after 3 redirects.')); } + + /** + * Tests Content-language headers generated by Drupal. + */ + function testDrupalHTTPRequestHeaders() { + // Check the default header. + $request = drupal_http_request(url('', array('absolute' => TRUE))); + $this->assertEqual($request->headers['content-language'], 'en', 'Content-Language HTTP header is English.'); + + // Add German language and set as default. + locale_add_language('de', 'German', 'Deutsch', LANGUAGE_LTR, '', '', TRUE, TRUE); + + // Request front page and check for matching Content-Language. + $request = drupal_http_request(url('', array('absolute' => TRUE))); + $this->assertEqual($request->headers['content-language'], 'de', 'Content-Language HTTP header is German.'); + } } /** -- cgit v1.2.3