You are here

public function ConfigTranslationUiTest::testSingleLanguageUI in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationUiTest::testSingleLanguageUI()
  2. 10 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 859

Class

ConfigTranslationUiTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testSingleLanguageUI() {
  $this
    ->drupalLogin($this->adminUser);

  // Delete French language
  $this
    ->drupalPostForm('admin/config/regional/language/delete/fr', [], t('Delete'));
  $this
    ->assertRaw(t('The %language (%langcode) language has been removed.', [
    '%language' => 'French',
    '%langcode' => 'fr',
  ]));

  // Change default language to Tamil.
  $edit = [
    'site_default_language' => 'ta',
  ];
  $this
    ->drupalPostForm('admin/config/regional/language', $edit, t('Save configuration'));
  $this
    ->assertRaw(t('Configuration saved.'));

  // Delete English language
  $this
    ->drupalPostForm('admin/config/regional/language/delete/en', [], t('Delete'));
  $this
    ->assertRaw(t('The %language (%langcode) language has been removed.', [
    '%language' => 'English',
    '%langcode' => 'en',
  ]));

  // Visit account setting translation page, this should not
  // throw any notices.
  $this
    ->drupalGet('admin/config/people/accounts/translate');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}