You are here

function ContentTranslationSettingsTest::testAccountLanguageSettingsUI in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php \Drupal\content_translation\Tests\ContentTranslationSettingsTest::testAccountLanguageSettingsUI()

Tests the language settings checkbox on account settings page.

File

core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php, line 208
Contains \Drupal\content_translation\Tests\ContentTranslationSettingsTest.

Class

ContentTranslationSettingsTest
Tests the content translation settings UI.

Namespace

Drupal\content_translation\Tests

Code

function testAccountLanguageSettingsUI() {

  // Make sure the checkbox is available and not checked by default.
  $this
    ->drupalGet('admin/config/people/accounts');
  $this
    ->assertField('language[content_translation]');
  $this
    ->assertNoFieldChecked('edit-language-content-translation');
  $edit = array(
    'language[content_translation]' => TRUE,
  );
  $this
    ->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
  $this
    ->drupalGet('admin/config/people/accounts');
  $this
    ->assertFieldChecked('edit-language-content-translation');

  // Make sure account settings can be saved.
  $this
    ->drupalPostForm('admin/config/people/accounts', array(
    'anonymous' => 'Save me please!',
  ), 'Save configuration');
  $this
    ->assertFieldByName('anonymous', 'Save me please!', 'Anonymous name has been changed.');
  $this
    ->assertText('The configuration options have been saved.');
}