You are here

public function LanguageUnitTest::testGetName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php \Drupal\Tests\Core\Language\LanguageUnitTest::testGetName()

@covers ::getName

File

core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php, line 37
Contains \Drupal\Tests\Core\Language\LanguageUnitTest.

Class

LanguageUnitTest
@coversDefaultClass \Drupal\Core\Language\Language @group Language

Namespace

Drupal\Tests\Core\Language

Code

public function testGetName() {
  $name = $this
    ->randomMachineName();
  $language_code = $this
    ->randomMachineName(2);
  $language = new Language(array(
    'id' => $language_code,
    'name' => $name,
  ));
  $this
    ->assertSame($name, $language
    ->getName());
}