function MigrateDefaultLanguageTest::testMigrationWithUnsetVariable
Tests language_default migration with unset default language variable.
File
- 
              core/
modules/ language/ tests/ src/ Kernel/ Migrate/ d6/ MigrateDefaultLanguageTest.php, line 61  
Class
- MigrateDefaultLanguageTest
 - Tests the default language variable migration.
 
Namespace
Drupal\Tests\language\Kernel\Migrate\d6Code
public function testMigrationWithUnsetVariable() : void {
  // 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'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.