$edit =
[ 'language_negotiation_url_part' => LanguageNegotiationUrl::CONFIG_DOMAIN,
'domain[en]' => '',
];
$this->
drupalGet('admin/config/regional/language/detection/url'
);
$this->
submitForm($edit, 'Save configuration'
);
$this->
assertSession()->
statusMessageContains('The domain may not be left blank for English', 'error'
);
// Change the domain for the Italian language.
$edit =
[ 'language_negotiation_url_part' => LanguageNegotiationUrl::CONFIG_DOMAIN,
'domain[en]' => \Drupal::
request()->
getHost(),
'domain[it]' => 'it.example.com',
];
$this->
drupalGet('admin/config/regional/language/detection/url'
);
$this->
submitForm($edit, 'Save configuration'
);
$this->
assertSession()->
statusMessageContains('The configuration options have been saved', 'status'
);
// Enable the language switcher block.
$this->
drupalPlaceBlock('language_block:' . LanguageInterface::TYPE_INTERFACE,
['id' => 'test_language_block'
]);
$this->
drupalGet(''
);