function LanguageUnitTest::testGetLangcode
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php \Drupal\Tests\Core\Language\LanguageUnitTest::testGetLangcode()
- 10 core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php \Drupal\Tests\Core\Language\LanguageUnitTest::testGetLangcode()
- 11.x 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\LanguageCode
public function testGetLangcode() {
$language_code = $this->randomMachineName(2);
$language = new Language([
'id' => $language_code,
]);
$this->assertSame($language_code, $language->getId());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.