You are here

public function LanguageUnitTest::testGetLangcode in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php \Drupal\Tests\Core\Language\LanguageUnitTest::testGetLangcode()
  2. 9 core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php \Drupal\Tests\Core\Language\LanguageUnitTest::testGetLangcode()

@covers ::getId

File

core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php, line 42

Class

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

Namespace

Drupal\Tests\Core\Language

Code

public function testGetLangcode() {
  $language_code = $this
    ->randomMachineName(2);
  $language = new Language([
    'id' => $language_code,
  ]);
  $this
    ->assertSame($language_code, $language
    ->getId());
}