Commit 41b6af54 authored by webchick's avatar webchick

Issue #2353763 by phenaproxima, oadaeh: Variable to config: menu.settings [d7]

parent bdbd7d3b
id: d6_menu_settings
label: Drupal 6 menu configuration
id: menu_settings
label: Menu UI configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: variable
variables:
- menu_primary_links_source
- menu_secondary_links_source
- menu_override_parent_selector
process:
main_links: menu_primary_links_source
secondary_links: menu_secondary_links_source
override_parent_selector: menu_override_parent_selector
destination:
plugin: config
......
<?php
/**
* @file
* Contains \Drupal\menu_ui\Tests\Migrate\MigrateMenuSettingsTest.
*/
namespace Drupal\menu_ui\Tests\Migrate;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Tests migration of menu_ui settings.
*
* @group menu_ui
*/
class MigrateMenuSettingsTest extends MigrateDrupal7TestBase {
public static $modules = ['menu_ui'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(['menu_ui']);
$this->loadDumps(['Variable.php']);
$this->executeMigration('menu_settings');
}
public function testMigration() {
$this->assertTrue(\Drupal::config('menu_ui.settings')->get('override_parent_selector'));
}
}
<?php
/**
* @file
* Contains \Drupal\menu_ui\Tests\Migrate\d6\MigrateMenuConfigsTest.
*/
namespace Drupal\menu_ui\Tests\Migrate\d6;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/**
* Upgrade variables to menu_ui.settings.yml.
*
* @group menu_ui
*/
class MigrateMenuConfigsTest extends MigrateDrupal6TestBase {
use SchemaCheckTestTrait;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('menu_ui');
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_menu_settings');
}
/**
* Tests migration of variables for the Menu UI module.
*/
public function testMenuSettings() {
$config = $this->config('menu_ui.settings');
$this->assertIdentical(FALSE, $config->get('override_parent_selector'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'menu_ui.settings', $config->get());
}
}
......@@ -211,6 +211,9 @@ public function load() {
))->values(array(
'name' => 'menu_options_test_content_type',
'value' => 'a:4:{i:0;s:9:"main-menu";i:1;s:10:"management";i:2;s:10:"navigation";i:3;s:9:"user-menu";}',
))->values(array(
'name' => 'menu_override_parent_selector',
'value' => 'b:1;',
))->values(array(
'name' => 'menu_parent_test_content_type',
'value' => 's:11:"main-menu:0";',
......@@ -464,4 +467,4 @@ public function load() {
}
}
#029f6b476578be5d7449a86251be1c77
#b936ad0308ecdde6a8fe71fd158c6719
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