summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-10-05 10:18:41 (GMT)
committerAlex Pott2014-10-05 10:18:41 (GMT)
commit853741a8db35fa0001b32daf605d6dc99706282d (patch)
tree5c2586bd2107089973957afa02cc268d6ff14d84
parentb35d190d28ec96adc10ca5d829ed27e68531b270 (diff)
Issue #2350543 by Schnitzel: Fixed #2343943 introduced gethostname(), which breaks on new testbot .
-rw-r--r--core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php7
-rw-r--r--core/modules/language/src/Tests/LanguageUrlRewritingTest.php5
2 files changed, 10 insertions, 2 deletions
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index 6a81438..c38d93e 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -391,6 +391,11 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
* Tests _url() when separate domains are used for multiple languages.
*/
function testLanguageDomain() {
+ global $base_url;
+
+ // Get the current host URI we're running on.
+ $base_url_host = parse_url($base_url, PHP_URL_HOST);
+
// Add the Italian language.
ConfigurableLanguage::createFromLangcode('it')->save();
@@ -415,7 +420,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
// Change the domain for the Italian language.
$edit = array(
'language_negotiation_url_part' => LanguageNegotiationUrl::CONFIG_DOMAIN,
- 'domain[en]' => gethostname(),
+ 'domain[en]' => $base_url_host,
'domain[it]' => 'it.example.com',
);
$this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
diff --git a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
index 0d4c2ce..2876ab6 100644
--- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
@@ -98,10 +98,13 @@ class LanguageUrlRewritingTest extends WebTestBase {
* Check URL rewriting when using a domain name and a non-standard port.
*/
function testDomainNameNegotiationPort() {
+ global $base_url;
$language_domain = 'example.fr';
+ // Get the current host URI we're running on.
+ $base_url_host = parse_url($base_url, PHP_URL_HOST);
$edit = array(
'language_negotiation_url_part' => LanguageNegotiationUrl::CONFIG_DOMAIN,
- 'domain[en]' => gethostname(),
+ 'domain[en]' => $base_url_host,
'domain[fr]' => $language_domain
);
$this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));