function ConfigTranslationUiTest::testSingleLanguageUI

Same name in other branches
  1. 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::testSingleLanguageUI()
  2. 8.9.x core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::testSingleLanguageUI()
  3. 11.x 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 252

Class

ConfigTranslationUiTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testSingleLanguageUI() : void {
    $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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.