You are here

public function ConfigurableLanguageTest::testName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/Tests/ConfigurableLanguageTest.php \Drupal\language\Tests\ConfigurableLanguageTest::testName()

Tests configurable language name methods.

File

core/modules/language/src/Tests/ConfigurableLanguageTest.php, line 30
Contains \Drupal\language\Tests\ConfigurableLanguageTest.

Class

ConfigurableLanguageTest
Tests the ConfigurableLanguage entity.

Namespace

Drupal\language\Tests

Code

public function testName() {
  $name = $this
    ->randomMachineName();
  $language_code = $this
    ->randomMachineName(2);
  $configurableLanguage = new ConfigurableLanguage(array(
    'label' => $name,
    'id' => $language_code,
  ), 'configurable_language');
  $this
    ->assertEqual($configurableLanguage
    ->getName(), $name);
  $this
    ->assertEqual($configurableLanguage
    ->setName('Test language')
    ->getName(), 'Test language');
}