function LanguageUILanguageNegotiationTest::testContentCustomization
Same name in other branches
- 9 core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php \Drupal\Tests\language\Functional\LanguageUILanguageNegotiationTest::testContentCustomization()
- 10 core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php \Drupal\Tests\language\Functional\LanguageUILanguageNegotiationTest::testContentCustomization()
- 11.x core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php \Drupal\Tests\language\Functional\LanguageUILanguageNegotiationTest::testContentCustomization()
Tests persistence of negotiation settings for the content language type.
File
-
core/
modules/ language/ tests/ src/ Functional/ LanguageUILanguageNegotiationTest.php, line 551
Class
- LanguageUILanguageNegotiationTest
- Tests the language UI for language switching.
Namespace
Drupal\Tests\language\FunctionalCode
public function testContentCustomization() {
// Customize content language settings from their defaults.
$edit = [
'language_content[configurable]' => TRUE,
'language_content[enabled][language-url]' => FALSE,
'language_content[enabled][language-session]' => TRUE,
];
$this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
// Check if configurability persisted.
$config = $this->config('language.types');
$this->assertContains('language_interface', $config->get('configurable'), 'Interface language is configurable.');
$this->assertContains('language_content', $config->get('configurable'), 'Content language is configurable.');
// Ensure configuration was saved.
$this->assertArrayNotHasKey('language-url', $config->get('negotiation.language_content.enabled'));
$this->assertArrayHasKey('language-session', $config->get('negotiation.language_content.enabled'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.