function MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNonExistentVariables

Same name in other branches
  1. 8.9.x core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNonExistentVariables()
  2. 10 core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNonExistentVariables()
  3. 11.x core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNonExistentVariables()

Tests the migration with non-existent variables.

File

core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php, line 119

Class

MigrateLanguageNegotiationSettingsTest
Tests the migration of language negotiation.

Namespace

Drupal\Tests\language\Kernel\Migrate\d7

Code

public function testLanguageNegotiationWithNonExistentVariables() {
    $this->sourceDatabase
        ->delete('variable')
        ->condition('name', [
        'local_language_negotiation_url_part',
        'local_language_negotiation_session_param',
    ], 'IN')
        ->execute();
    $this->executeMigrations([
        'language',
        'd6_language_negotiation_settings',
        'language_prefixes_and_domains',
    ]);
    $config = $this->config('language.negotiation');
    $this->assertSame('language', $config->get('session.parameter'));
    $this->assertSame(LanguageNegotiationUrl::CONFIG_PATH_PREFIX, $config->get('url.source'));
    $this->assertSame('site_default', $config->get('selected_langcode'));
    $expected_prefixes = [
        'en' => '',
        'fr' => 'fr',
        'is' => 'is',
    ];
    $this->assertSame($expected_prefixes, $config->get('url.prefixes'));
}

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