Issue #2130307 by quietone, michaellenahan, phenaproxima, David Hernández, fastangel, eliza411: Variable to config: language.negotiation [d7]
parent
6466caad89
commit
5da22c7a8c
|
@ -0,0 +1,15 @@
|
|||
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
|
|
@ -0,0 +1,43 @@
|
|||
<?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 @@ class Variable extends DrupalDumpBase {
|
|||
))->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 @@ class Variable extends DrupalDumpBase {
|
|||
}
|
||||
|
||||
}
|
||||
#e9148e9bed6f5b345cc1a281afe38dd0
|
||||
#6c379107303f95fe9118597506168dc2
|
||||
|
|
Loading…
Reference in New Issue