You are here

function UserAdminLanguageTest::addCustomLanguage in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/user/src/Tests/UserAdminLanguageTest.php \Drupal\user\Tests\UserAdminLanguageTest::addCustomLanguage()

Helper method for adding a custom language.

3 calls to UserAdminLanguageTest::addCustomLanguage()
UserAdminLanguageTest::testActualNegotiation in core/modules/user/src/Tests/UserAdminLanguageTest.php
Tests the actual language negotiation.
UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIsEnabled in core/modules/user/src/Tests/UserAdminLanguageTest.php
Tests that the admin language is configurable only for administrators.
UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation in core/modules/user/src/Tests/UserAdminLanguageTest.php
Tests that admin language negotiation is configurable only if enabled.

File

core/modules/user/src/Tests/UserAdminLanguageTest.php, line 176
Contains \Drupal\user\Tests\UserAdminLanguageTest.

Class

UserAdminLanguageTest
Tests users' ability to change their own administration language.

Namespace

Drupal\user\Tests

Code

function addCustomLanguage() {
  $langcode = 'xx';

  // The English name for the language.
  $name = $this
    ->randomMachineName(16);
  $edit = array(
    'predefined_langcode' => 'custom',
    'langcode' => $langcode,
    'label' => $name,
    'direction' => LanguageInterface::DIRECTION_LTR,
  );
  $this
    ->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
}