diff -u b/core/modules/user/migration_templates/user_mail.yml b/core/modules/user/migration_templates/user_mail.yml --- b/core/modules/user/migration_templates/user_mail.yml +++ b/core/modules/user/migration_templates/user_mail.yml @@ -16,8 +16,8 @@ - user_mail_register_admin_created_body - user_mail_register_no_approval_required_subject - user_mail_register_no_approval_required_body - - user_mail_register_pending_approval_subject - - user_mail_register_pending_approval_body + - user_mail_user_mail_register_pending_approval_subject + - user_mail_user_mail_register_pending_approval_body - user_mail_status_blocked_subject - user_mail_status_blocked_body process: @@ -25,14 +25,14 @@ 'status_activated/body': user_mail_status_activated_body 'password_reset/subject': user_mail_password_reset_subject 'password_reset/body': user_mail_password_reset_body - 'cancel_confirm/subject': user_mail_status_canceled_subject - 'cancel_confirm/body': user_mail_status_canceled_body + 'cancel_confirm/subject': user_mail_status_deleted_subject + 'cancel_confirm/body': user_mail_status_deleted_body 'register_admin_created/subject': user_mail_register_admin_created_subject 'register_admin_created/body': user_mail_register_admin_created_body 'register_no_approval_required/subject': user_mail_register_no_approval_required_subject 'register_no_approval_required/body': user_mail_register_no_approval_required_body - 'register_pending_approval/subject': user_mail_register_pending_approval_subject - 'register_pending_approval/body': user_mail_register_pending_approval_body + 'register_pending_approval/subject': user_mail_user_mail_register_pending_approval_subject + 'register_pending_approval/body': user_mail_user_mail_register_pending_approval_body 'status_blocked/subject': user_mail_status_blocked_subject 'status_blocked/body': user_mail_status_blocked_body destination: diff -u b/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php --- b/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php @@ -28,6 +28,28 @@ } /** + * Tests migration of user variables to user.mail.yml. + */ + public function testUserMail() { + $config = $this->config('user.mail'); + $this->assertIdentical('Account details for !username at !site (approved)', $config->get('status_activated.subject')); + $this->assertIdentical("!username,\n\nYour account at !site has been activated.\n\nYou may now log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\nOnce you have set your own password, you will be able to log in to !login_uri in the future using:\n\nusername: !username\n", $config->get('status_activated.body')); + $this->assertIdentical('Replacement login information for !username at !site', $config->get('password_reset.subject')); + $this->assertIdentical("!username,\n\nA request to reset the password for your account has been made at !site.\n\nYou may now log in to !uri_brief by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once. It expires after one day and nothing will happen if it's not used.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.", $config->get('password_reset.body')); + $this->assertIdentical('Account details for !username at !site (deleted)', $config->get('cancel_confirm.subject')); + $this->assertIdentical("!username,\n\nYour account on !site has been deleted.", $config->get('cancel_confirm.body')); + $this->assertIdentical('An administrator created an account for you at !site', $config->get('register_admin_created.subject')); + $this->assertIdentical("!username,\n\nA site administrator at !site has created an account for you. You may now log in to !login_uri using the following username and password:\n\nusername: !username\npassword: !password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\n\n-- !site team", $config->get('register_admin_created.body')); + $this->assertIdentical('Account details for !username at !site', $config->get('register_no_approval_required.subject')); + $this->assertIdentical("!username,\n\nThank you for registering at !site. You may now log in to !login_uri using the following username and password:\n\nusername: !username\npassword: !password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\n\n-- !site team", $config->get('register_no_approval_required.body')); + $this->assertIdentical('Account details for !username at !site (pending admin approval)', $config->get('register_pending_approval.subject')); + $this->assertIdentical("!username,\n\nThank you for registering at !site. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.\n\n\n-- !site team", $config->get('register_pending_approval.body')); + $this->assertIdentical('Account details for !username at !site (blocked)', $config->get('status_blocked.subject')); + $this->assertIdentical("!username,\n\nYour account on !site has been blocked.", $config->get('status_blocked.body')); + $this->assertConfigSchema(\Drupal::service('config.typed'), 'user.mail', $config->get()); + } + + /** * Tests migration of user variables to user.settings.yml. */ public function testUserSettings() { diff -u b/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php b/core/modules/user/src/Tests/Migrate/d6/ProfileValuesBuilderTest.php --- b/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/ProfileValuesBuilderTest.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\user\Tests\Migrate\d7\UserMigrationBuilderTest. + * Contains \Drupal\user\Tests\Migrate\d6\ProfileValuesBuilderTest. */ -namespace Drupal\user\Tests\Migrate\d7; +namespace Drupal\user\Tests\Migrate\d6; -use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase; +use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * @group user */ -class UserMigrationBuilderTest extends MigrateDrupal7TestBase { +class ProfileValuesBuilderTest extends MigrateDrupal6TestBase { public static $modules = ['migrate', 'migrate_drupal', 'user']; @@ -22,15 +22,15 @@ */ public function testBuilder() { $template = \Drupal::service('migrate.template_storage') - ->getTemplateByName('d7_user'); + ->getTemplateByName('d6_profile_values'); /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ $migrations = \Drupal::service('plugin.manager.migrate.builder') - ->createInstance('d7_user') + ->createInstance('d6_profile_values') ->buildMigrations($template); - $this->assertIdentical('d7_user', $migrations[0]->id()); + $this->assertIdentical('d6_profile_values', $migrations[0]->id()); $process = $migrations[0]->getProcess(); - $this->assertIdentical('field_file', $process['field_file'][0]['source']); + $this->assertIdentical('profile_color', $process['profile_color'][0]['source']); } } only in patch2: unchanged: --- /dev/null +++ b/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php @@ -0,0 +1,36 @@ +getTemplateByName('d7_user'); + /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ + $migrations = \Drupal::service('plugin.manager.migrate.builder') + ->createInstance('d7_user') + ->buildMigrations($template); + + $this->assertIdentical('d7_user', $migrations[0]->id()); + $process = $migrations[0]->getProcess(); + $this->assertIdentical('field_file', $process['field_file'][0]['source']); + } + +}