You are here

public function MigrateDefaultLanguageTest::testMigrationWithExistingLanguage in Drupal 9

Same name in this branch
  1. 9 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithExistingLanguage()
  2. 9 core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateDefaultLanguageTest::testMigrationWithExistingLanguage()
Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithExistingLanguage()
  2. 10 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithExistingLanguage()

Tests language_default migration with an existing language.

File

core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php, line 24

Class

MigrateDefaultLanguageTest
Tests the default language variable migration.

Namespace

Drupal\Tests\language\Kernel\Migrate\d6

Code

public function testMigrationWithExistingLanguage() {
  $this
    ->setDefaultLanguage('fr');
  $this
    ->startCollectingMessages();
  $this
    ->executeMigrations([
    'language',
    'default_language',
  ]);

  // Tests the language is loaded and is the default language.
  $default_language = ConfigurableLanguage::load('fr');
  $this
    ->assertNotNull($default_language);
  $this
    ->assertSame('fr', $this
    ->config('system.site')
    ->get('default_langcode'));
}