public function ConfigTranslationUiTest::testSingleLanguageUI in Drupal 9
Same name and namespace in other branches
- 8 core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::testSingleLanguageUI()
Tests the single language existing.
File
- core/
modules/ config_translation/ tests/ src/ Functional/ ConfigTranslationUiTest.php, line 875
Class
- ConfigTranslationUiTest
- Translate settings and entities to various languages.
Namespace
Drupal\Tests\config_translation\FunctionalCode
public function testSingleLanguageUI() {
$this
->drupalLogin($this->adminUser);
// Delete French language
$this
->drupalGet('admin/config/regional/language/delete/fr');
$this
->submitForm([], 'Delete');
$this
->assertSession()
->pageTextContains('The French (fr) language has been removed.');
// Change default language to Tamil.
$edit = [
'site_default_language' => 'ta',
];
$this
->drupalGet('admin/config/regional/language');
$this
->submitForm($edit, 'Save configuration');
$this
->assertSession()
->pageTextContains('Configuration saved.');
// Delete English language
$this
->drupalGet('admin/config/regional/language/delete/en');
$this
->submitForm([], 'Delete');
$this
->assertSession()
->pageTextContains('The English (en) language has been removed.');
// Visit account setting translation page, this should not
// throw any notices.
$this
->drupalGet('admin/config/people/accounts/translate');
$this
->assertSession()
->statusCodeEquals(200);
}