public function MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNoNegotiation in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNoNegotiation()
- 9 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateLanguageNegotiationSettingsTest::testLanguageNegotiationWithNoNegotiation()
Tests the migration with LANGUAGE_NEGOTIATION_NONE.
File
- core/
modules/ language/ tests/ src/ Kernel/ Migrate/ d6/ MigrateLanguageNegotiationSettingsTest.php, line 57
Class
- MigrateLanguageNegotiationSettingsTest
- Tests the migration of language negotiation and language types.
Namespace
Drupal\Tests\language\Kernel\Migrate\d6Code
public function testLanguageNegotiationWithNoNegotiation() {
$this->sourceDatabase
->update('variable')
->fields([
'value' => serialize(0),
])
->condition('name', 'language_negotiation')
->execute();
$this
->executeMigrations([
'language',
'd6_language_negotiation_settings',
'language_prefixes_and_domains',
'd6_language_types',
]);
$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'));
$config = $this
->config('language.types');
$this
->assertSame([
'language_interface',
'language_content',
'language_url',
], $config
->get('all'));
$this
->assertSame([
'language_interface',
], $config
->get('configurable'));
$this
->assertSame([
'language-interface' => 0,
], $config
->get('negotiation.language_content.enabled'));
$this
->assertSame([
'language-url' => 0,
'language-url-fallback' => 1,
], $config
->get('negotiation.language_url.enabled'));
$expected_language_interface = [
'language-selected' => 0,
];
$this
->assertSame($expected_language_interface, $config
->get('negotiation.language_interface.enabled'));
}