diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-28 23:56:59 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-28 23:56:59 -0800 |
commit | cab259ab955456833c94ee6655db0f141894f6fb (patch) | |
tree | 4932746412d039f9d3dc8cfab7a37bb58b7f037b | |
parent | ca74991df619fbb4d2741b545ea460ef8c1ea82b (diff) | |
download | brdo-cab259ab955456833c94ee6655db0f141894f6fb.tar.gz brdo-cab259ab955456833c94ee6655db0f141894f6fb.tar.bz2 |
Issue #673020 by Zoltán Balogh, attiks, mgifford, Gábor Hojtsy, e2thex, good_man, kalman.hosszu | Fleshgrinder: Fixed Tests for adding the Content-Language HTTP header to the generated page.
-rw-r--r-- | modules/simpletest/tests/common.test | 18 |
1 files changed, 17 insertions, 1 deletions
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('<front>', 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('<front>', array('absolute' => TRUE))); + $this->assertEqual($request->headers['content-language'], 'de', 'Content-Language HTTP header is German.'); + } } /** |