You are here

public function MigrateDefaultLanguageTest::testMigrationWithUnsetVariable in Drupal 10

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

Tests language_default migration with unset default language variable.

File

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

Class

MigrateDefaultLanguageTest
Tests the default language variable migration.

Namespace

Drupal\Tests\language\Kernel\Migrate\d7

Code

public function testMigrationWithUnsetVariable() {

  // Delete the language_default variable.
  $this->sourceDatabase
    ->delete('variable')
    ->condition('name', 'language_default')
    ->execute();
  $this
    ->startCollectingMessages();
  $this
    ->executeMigrations([
    'language',
    'default_language',
  ]);
  $messages = $this->migration
    ->getIdMap()
    ->getMessages()
    ->fetchAll();

  // Make sure there's no migration exceptions.
  $this
    ->assertEmpty($messages);

  // Make sure the default langcode is 'en', as it was the default on D6 & D7.
  $this
    ->assertSame('en', $this
    ->config('system.site')
    ->get('default_langcode'));
}