Commit 5da22c7a authored by webchick's avatar webchick

Issue #2130307 by quietone, michaellenahan, phenaproxima, David Hernández,...

Issue #2130307 by quietone, michaellenahan, phenaproxima, David Hernández, fastangel, eliza411: Variable to config: language.negotiation [d7]
parent 6466caad
id: d7_language_negotiation_settings
label: Drupal 7 language negotiation settings
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- locale_language_negotiation_session_param
- locale_language_negotiation_url_part
process:
'session/parameter': locale_language_negotiation_session_param
'url/source': locale_language_negotiation_url_part
destination:
plugin: config
config_name: language.negotiation
<?php
/**
* @file
* Contains \Drupal\language\Tests\Migrate\d7\MigrateLanguageNegotiationSettingsTest.
*/
namespace Drupal\language\Tests\Migrate\d7;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Tests migration of language negotiation variables.
*
* @group language
*/
class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal7TestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['language'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d7_language_negotiation_settings');
}
/**
* Tests migration of language negotiation variables to language.negotiation.yml.
*/
public function testLanguageNegotiation() {
$config = $this->config('language.negotiation');
$this->assertIdentical($config->get('session.parameter'), 'language');
$this->assertIdentical($config->get('url.source'), 'domain');
}
}
......@@ -199,6 +199,12 @@ public function load() {
))->values(array(
'name' => 'language_types',
'value' => 'a:3:{s:8:"language";b:1;s:16:"language_content";b:0;s:12:"language_url";b:0;}',
))->values(array(
'name' => 'locale_language_negotiation_session_param',
'value' => 's:8:"language";',
))->values(array(
'name' => 'locale_language_negotiation_url_part',
'value' => 's:6:"domain";',
))->values(array(
'name' => 'maintenance_mode',
'value' => 'i:0;',
......@@ -482,4 +488,4 @@ public function load() {
}
}
#e9148e9bed6f5b345cc1a281afe38dd0
#6c379107303f95fe9118597506168dc2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment