You are here

public function LanguageUnitTest::testGetDirection in Drupal 9

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

@covers ::getDirection

File

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

Class

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

Namespace

Drupal\Tests\Core\Language

Code

public function testGetDirection() {
  $language_code = $this
    ->randomMachineName(2);
  $language = new Language([
    'id' => $language_code,
    'direction' => LanguageInterface::DIRECTION_RTL,
  ]);
  $this
    ->assertSame(LanguageInterface::DIRECTION_RTL, $language
    ->getDirection());
}