Commit 4fce2f9e authored by webchick's avatar webchick

Issue #2353703 by quietone, phenaproxima, miguelc303, ksenzee: Variable to...

Issue #2353703 by quietone, phenaproxima, miguelc303, ksenzee: Variable to config: forum.settings [d7]
parent 227f5200
id: d7_forum_settings
label: Forum configuration
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- forum_hot_topic
- forum_per_page
- forum_order
- forum_block_num_active
- forum_block_num_new
- forum_nav_vocabulary
process:
'block/active/limit': forum_block_num_active
'block/new/limit': forum_block_num_new
'topics/hot_threshold': forum_hot_topic
'topics/page_limit': forum_per_page
'topics/order': forum_order
vocabulary:
plugin: migration
migration: d7_taxonomy_vocabulary
source: forum_nav_vocabulary
destination:
plugin: config
config_name: forum.settings
migration_dependencies:
required:
- d7_taxonomy_vocabulary
<?php
/**
* @file
* Contains \Drupal\forum\Tests\d7\MigrateForumSettingsTest.
*/
namespace Drupal\forum\Tests\Migrate\d7;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Tests migration of Forum's variables to configuration.
*
* @group forum
*/
class MigrateForumSettingsTest extends MigrateDrupal7TestBase {
// Don't alphabetize these. They're in dependency order.
public static $modules = [
'comment',
'field',
'filter',
'entity_reference',
'text',
'node',
'taxonomy',
'forum',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->executeMigration('d7_taxonomy_vocabulary');
$this->executeMigration('d7_forum_settings');
}
/**
* Tests the migration of Forum's settings to configuration.
*/
public function testForumSettingsMigration() {
$config = $this->config('forum.settings');
$this->assertIdentical(9, $config->get('block.active.limit'));
$this->assertIdentical(4, $config->get('block.new.limit'));
$this->assertIdentical(10, $config->get('topics.hot_threshold'));
$this->assertIdentical(25, $config->get('topics.page_limit'));
$this->assertIdentical(1, $config->get('topics.order'));
$this->assertIdentical('forums', $config->get('vocabulary'));
}
}
......@@ -292,12 +292,27 @@ public function load() {
))->values(array(
'name' => 'filter_fallback_format',
'value' => 's:10:"plain_text";',
))->values(array(
'name' => 'forum_block_num_active',
'value' => 'i:9;',
))->values(array(
'name' => 'forum_block_num_new',
'value' => 'i:4;',
))->values(array(
'name' => 'forum_containers',
'value' => 'a:1:{i:0;s:1:"6";}',
))->values(array(
'name' => 'forum_hot_topic',
'value' => 'i:10;',
))->values(array(
'name' => 'forum_nav_vocabulary',
'value' => 's:1:"2";',
))->values(array(
'name' => 'forum_order',
'value' => 'i:1;',
))->values(array(
'name' => 'forum_per_page',
'value' => 'i:25;',
))->values(array(
'name' => 'image_style_preview_image',
'value' => 's:33:"core/modules/image/testsample.png";',
......@@ -692,4 +707,4 @@ public function load() {
}
}
#ce49dea65e803f696bbb2b7adb81548b
#d20a0a7f31645aba285f0ce7505c80a5
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