You are here

public function ConfigTranslationUiTest::testSingleLanguageUI in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php \Drupal\config_translation\Tests\ConfigTranslationUiTest::testSingleLanguageUI()

Tests the single language existing.

File

core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php, line 787
Contains \Drupal\config_translation\Tests\ConfigTranslationUiTest.

Class

ConfigTranslationUiTest
Translate settings and entities to various languages.

Namespace

Drupal\config_translation\Tests

Code

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

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

  // Change default language to Tamil.
  $edit = array(
    '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', array(), t('Delete'));
  $this
    ->assertRaw(t('The %language (%langcode) language has been removed.', array(
    '%language' => 'English',
    '%langcode' => 'en',
  )));

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