function MigrateDefaultLanguageTest::testMigrationWithUnsetVariable

Same name in this branch
  1. 9 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithUnsetVariable()
Same name in other branches
  1. 8.9.x core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithUnsetVariable()
  2. 8.9.x core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateDefaultLanguageTest::testMigrationWithUnsetVariable()
  3. 10 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithUnsetVariable()
  4. 10 core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateDefaultLanguageTest::testMigrationWithUnsetVariable()
  5. 11.x core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateDefaultLanguageTest::testMigrationWithUnsetVariable()
  6. 11.x 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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.