You are here

public function MigrateDefaultLanguageTest::testMigrationWithExistingLanguage in Drupal 8

Same name in this branch
  1. 8 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithExistingLanguage()
  2. 8 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. 9 core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateDefaultLanguageTest::testMigrationWithExistingLanguage()

Tests language_default migration with a non-existing language.

File

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

Class

MigrateDefaultLanguageTest
Tests the default language variable migration.

Namespace

Drupal\Tests\language\Kernel\Migrate\d7

Code

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

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