You are here

protected function MigrateLanguageTest::assertLanguage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateLanguageTest::assertLanguage()
  2. 9 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateLanguageTest::assertLanguage()

Asserts various properties of a configurable language entity.

@internal

Parameters

string $id: The language ID.

string $label: The language name.

string $direction: (optional) The language's direction (one of the DIRECTION_* constants in ConfigurableLanguageInterface). Defaults to LTR.

int $weight: (optional) The weight of the language. Defaults to 0.

1 call to MigrateLanguageTest::assertLanguage()
MigrateLanguageTest::testLanguageMigration in core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php
Tests migration of Drupal 6 languages to configurable language entities.

File

core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php, line 34

Class

MigrateLanguageTest
@group migrate_drupal_6

Namespace

Drupal\Tests\language\Kernel\Migrate\d6

Code

protected function assertLanguage(string $id, string $label, string $direction = ConfigurableLanguageInterface::DIRECTION_LTR, int $weight = 0) : void {

  /** @var \Drupal\language\ConfigurableLanguageInterface $language */
  $language = ConfigurableLanguage::load($id);
  $this
    ->assertInstanceOf(ConfigurableLanguageInterface::class, $language);
  $this
    ->assertSame($label, $language
    ->label());
  $this
    ->assertSame($direction, $language
    ->getDirection());
  $this
    ->assertSame(0, $language
    ->getWeight());
  $this
    ->assertFalse($language
    ->isLocked());
}