Commit fb35534d authored by alexpott's avatar alexpott

Issue #2409415 by phenaproxima, hosef: Variable to config: aggregator.settings [d7]

parent f5cdc332
id: d7_aggregator_settings
label: Drupal 7 aggregator configuration
migration_tags:
- Drupal 7
source:
plugin: variable
variables:
- aggregator_fetcher
- aggregator_parser
- aggregator_processors
- aggregator_allowed_html_tags
- aggregator_teaser_length
- aggregator_clear
- aggregator_summary_items
process:
fetcher: aggregator_fetcher
parser: aggregator_parser
processors: aggregator_processors
'items/allowed_html': aggregator_allowed_html_tags
'items/teaser_length': aggregator_teaser_length
'items/expire': aggregator_clear
'source/list_max': aggregator_summary_items
destination:
plugin: config
config_name: aggregator.settings
......@@ -49,6 +49,27 @@ public function load() {
))->values(array(
'name' => 'admin_theme',
'value' => 's:5:"seven";',
))->values(array(
'name' => 'aggregator_allowed_html_tags',
'value' => 's:13:"<p> <div> <a>";',
))->values(array(
'name' => 'aggregator_clear',
'value' => 'i:86400;',
))->values(array(
'name' => 'aggregator_fetcher',
'value' => 's:10:"aggregator";',
))->values(array(
'name' => 'aggregator_parser',
'value' => 's:10:"aggregator";',
))->values(array(
'name' => 'aggregator_processors',
'value' => 'a:1:{i:0;s:10:"aggregator";}',
))->values(array(
'name' => 'aggregator_summary_items',
'value' => 'i:6;',
))->values(array(
'name' => 'aggregator_teaser_length',
'value' => 'i:500;',
))->values(array(
'name' => 'allow_insecure_derivatives',
'value' => 'b:1;',
......@@ -419,4 +440,4 @@ public function load() {
}
}
#dfc4cdd451a6575677b8c10442893d26
#6e1892883e650f9e71e165fa6737ac4c
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\d7\MigrateAggregatorSettingsTest.
*/
namespace Drupal\migrate_drupal\Tests\d7;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate\MigrateExecutable;
/**
* Tests migration of Aggregator's variables to configuration.
*
* @group migrate_drupal_7
*/
class MigrateAggregatorSettingsTest extends MigrateDrupal7TestBase {
public static $modules = ['aggregator'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->loadDumps([
$this->getDumpDirectory() . '/Variable.php',
]);
$migration = Migration::load('d7_aggregator_settings');
(new MigrateExecutable($migration, $this))->import();
}
/**
* Tests migration of Aggregator variables to configuration.
*/
public function testMigration() {
$config = \Drupal::config('aggregator.settings')->get();
$this->assertIdentical('aggregator', $config['fetcher']);
$this->assertIdentical('aggregator', $config['parser']);
$this->assertIdentical(['aggregator'], $config['processors']);
$this->assertIdentical('<p> <div> <a>', $config['items']['allowed_html']);
$this->assertIdentical(500, $config['items']['teaser_length']);
$this->assertIdentical(86400, $config['items']['expire']);
$this->assertIdentical(6, $config['source']['list_max']);
}
}
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