Commit 81d6f870 authored by webchick's avatar webchick

Issue #2353729 by ultimike: D6->D8 Migration missing variable: user_mail_status_blocked_notify.

parent a9e5c2fc
id: d6_user_settings
label: Drupal 6 user configuration
migration_groups:
- Drupal 6
source:
plugin: variable
variables:
- user_mail_status_blocked_notify
- user_mail_status_activated_notify
- user_signatures
- user_email_verification
- user_register
- anonymous
process:
'notify/status_blocked': user_mail_status_blocked_notify
'notify/status_activated': user_mail_status_activated_notify
signatures: user_signatures
verify_mail: user_email_verification
register:
plugin: static_map
source: user_register
default_value: visitors_admin_approval
map:
2: visitors_admin_approval
1: user_register
0: admin_only
anonymous: anonymous
destination:
plugin: config
config_name: user.settings
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\Dump\Drupal6UserSettings.
*/
namespace Drupal\migrate_drupal\Tests\Dump;
/**
* Database dump for testing user.settings.yml migration.
*/
class Drupal6UserSettings extends Drupal6DumpBase {
/**
* {@inheritdoc}
*/
public function load() {
$this->createTable('variable');
$this->database->insert('variable')->fields(array(
'name',
'value',
))
->values(array(
'name' => 'user_mail_status_blocked_notify',
'value' => 'i:1;',
))
->values(array(
'name' => 'user_mail_status_activated_notify',
'value' => 'i:0;',
))
->values(array(
'name' => 'user_signatures',
'value' => 's:1:"1";',
))
->values(array(
'name' => 'user_email_verification',
'value' => 'i:0;',
))
->values(array(
'name' => 'user_register',
'value' => 'i:0;',
))
->values(array(
'name' => 'anonymous',
'value' => 's:5:"Guest";',
))
->execute();
}
}
......@@ -130,6 +130,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_user_picture_field',
'd6_user_picture_file',
'd6_user_role',
'd6_user_settings',
'd6_user',
'd6_view_modes',
'd6_vocabulary_entity_display',
......@@ -210,6 +211,7 @@ protected function getDumps() {
$tests_path . '/Drupal6User.php',
$tests_path . '/Drupal6UserProfileFields.php',
$tests_path . '/Drupal6UserRole.php',
$tests_path . '/Drupal6UserSettings.php',
$tests_path . '/Drupal6VocabularyField.php',
);
......
......@@ -25,10 +25,18 @@ class MigrateUserConfigsTest extends MigrateDrupalTestBase {
*/
protected function setUp() {
parent::setUp();
$migration = entity_load('migration', 'd6_user_mail');
$dumps = array(
$this->getDumpDirectory() . '/Drupal6UserMail.php',
);
$migration = entity_load('migration', 'd6_user_mail');
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
$executable->import();
$dumps = array(
$this->getDumpDirectory() . '/Drupal6UserSettings.php',
);
$migration = entity_load('migration', 'd6_user_settings');
$this->prepare($migration, $dumps);
$executable = new MigrateExecutable($migration, $this);
$executable->import();
......@@ -56,4 +64,17 @@ public function testUserMail() {
$this->assertConfigSchema(\Drupal::service('config.typed'), 'user.mail', $config->get());
}
/**
* Tests migration of user variables to user.settings.yml.
*/
public function testUserSettings() {
$config = \Drupal::config('user.settings');
$this->assertIdentical($config->get('notify.status_blocked'), TRUE);
$this->assertIdentical($config->get('notify.status_activated'), FALSE);
$this->assertIdentical($config->get('signatures'), TRUE);
$this->assertIdentical($config->get('verify_mail'), FALSE);
$this->assertIdentical($config->get('register'), 'admin_only');
$this->assertIdentical($config->get('anonymous'), 'Guest');
}
}
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