Loading core/modules/migrate_drupal/src/Tests/Table/d6/ProfileFields.php +15 −1 Changes for core/modules/migrate_drupal/src/Tests/Table/d6/ProfileFields.php: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -212,8 +212,22 @@ public function load() { 'visibility' => '2', 'autocomplete' => '0', 'options' => '', ))->values(array( 'fid' => '16', 'title' => 'Blog', 'name' => 'profile_blog', 'explanation' => 'Paste the full URL, including http://, of your personal blog.', 'category' => 'Personal information', 'page' => '', 'type' => 'url', 'weight' => '3', 'required' => '0', 'register' => '0', 'visibility' => '3', 'autocomplete' => '0', 'options' => '', ))->execute(); } } #59b9afb9195888ed98c5b2dc0c35305c #f403976a12145f09209b3a2781684305 core/modules/user/migration_templates/user_profile_entity_display.yml +4 −1 Changes for core/modules/user/migration_templates/user_profile_entity_display.yml: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ process: selection: list_default textfield: text_default textarea: text_default url: link_default url: link options: 'constants/options' 'options/type': @type hidden: Loading @@ -39,3 +39,6 @@ process: 4: true # PROFILE_HIDDEN destination: plugin: component_entity_display migration_dependencies: required: - user_profile_field_instance core/modules/user/src/Tests/Migrate/MigrateUserProfileEntityDisplayTest.php +2 −61 Changes for core/modules/user/src/Tests/Migrate/MigrateUserProfileEntityDisplayTest.php: 2 added lines, 61 removed lines. Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ namespace Drupal\user\Tests\Migrate; use Drupal\Core\Database\Database; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** Loading @@ -29,66 +28,8 @@ class MigrateUserProfileEntityDisplayTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); // Create some fields so the data gets stored. entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_color', 'type' => 'text', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_biography', 'type' => 'text_long', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_sell_address', 'type' => 'boolean', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_sold_to', 'type' => 'list_string', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_bands', 'type' => 'text', 'cardinality' => -1, ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_blog', 'type' => 'link', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_birthdate', 'type' => 'datetime', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); $field_data = Database::getConnection('default', 'migrate') ->select('profile_fields', 'u') ->fields('u') ->execute() ->fetchAll(); foreach ($field_data as $field) { entity_create('field_config', array( 'label' => $field->title, 'description' => '', 'field_name' => $field->name, 'entity_type' => 'user', 'bundle' => 'user', 'required' => 1, ))->save(); } $this->executeMigration('user_profile_field'); $this->executeMigration('user_profile_field_instance'); $this->executeMigration('user_profile_entity_display'); } Loading core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldInstanceTest.php +2 −4 Changes for core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldInstanceTest.php: 2 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -64,12 +64,10 @@ public function testUserProfileFields() { $this->assertIdentical('Favorite bands', $field->label()); $this->assertIdentical("Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites.", $field->getDescription()); /* // Migrated URL field. $field = FieldConfig::load('user.user.profile_blog'); $this->assertIdentical('Your blog', $field->label()); $this->assertIdentical("Paste the full URL, $field->getDescription(), including http://, of your personal blog."); */ $this->assertIdentical('Blog', $field->label()); $this->assertIdentical("Paste the full URL, including http://, of your personal blog.", $field->getDescription()); // Migrated date field. $field = FieldConfig::load('user.user.profile_birthdate'); Loading core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldTest.php +0 −2 Changes for core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldTest.php: 0 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -64,11 +64,9 @@ public function testUserProfileFields() { $this->assertIdentical('text', $field_storage->getType(), 'Field type is text.'); $this->assertIdentical(-1, $field_storage->getCardinality(), 'List field has correct cardinality'); /* // Migrated URL field. $field_storage = FieldStorageConfig::load('user.profile_blog'); $this->assertIdentical('link', $field_storage->getType(), 'Field type is link.'); */ // Migrated date field. $field_storage = FieldStorageConfig::load('user.profile_birthdate'); Loading Loading
core/modules/migrate_drupal/src/Tests/Table/d6/ProfileFields.php +15 −1 Changes for core/modules/migrate_drupal/src/Tests/Table/d6/ProfileFields.php: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -212,8 +212,22 @@ public function load() { 'visibility' => '2', 'autocomplete' => '0', 'options' => '', ))->values(array( 'fid' => '16', 'title' => 'Blog', 'name' => 'profile_blog', 'explanation' => 'Paste the full URL, including http://, of your personal blog.', 'category' => 'Personal information', 'page' => '', 'type' => 'url', 'weight' => '3', 'required' => '0', 'register' => '0', 'visibility' => '3', 'autocomplete' => '0', 'options' => '', ))->execute(); } } #59b9afb9195888ed98c5b2dc0c35305c #f403976a12145f09209b3a2781684305
core/modules/user/migration_templates/user_profile_entity_display.yml +4 −1 Changes for core/modules/user/migration_templates/user_profile_entity_display.yml: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ process: selection: list_default textfield: text_default textarea: text_default url: link_default url: link options: 'constants/options' 'options/type': @type hidden: Loading @@ -39,3 +39,6 @@ process: 4: true # PROFILE_HIDDEN destination: plugin: component_entity_display migration_dependencies: required: - user_profile_field_instance
core/modules/user/src/Tests/Migrate/MigrateUserProfileEntityDisplayTest.php +2 −61 Changes for core/modules/user/src/Tests/Migrate/MigrateUserProfileEntityDisplayTest.php: 2 added lines, 61 removed lines. Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ namespace Drupal\user\Tests\Migrate; use Drupal\Core\Database\Database; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** Loading @@ -29,66 +28,8 @@ class MigrateUserProfileEntityDisplayTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); // Create some fields so the data gets stored. entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_color', 'type' => 'text', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_biography', 'type' => 'text_long', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_sell_address', 'type' => 'boolean', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_sold_to', 'type' => 'list_string', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_bands', 'type' => 'text', 'cardinality' => -1, ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_blog', 'type' => 'link', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_birthdate', 'type' => 'datetime', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); $field_data = Database::getConnection('default', 'migrate') ->select('profile_fields', 'u') ->fields('u') ->execute() ->fetchAll(); foreach ($field_data as $field) { entity_create('field_config', array( 'label' => $field->title, 'description' => '', 'field_name' => $field->name, 'entity_type' => 'user', 'bundle' => 'user', 'required' => 1, ))->save(); } $this->executeMigration('user_profile_field'); $this->executeMigration('user_profile_field_instance'); $this->executeMigration('user_profile_entity_display'); } Loading
core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldInstanceTest.php +2 −4 Changes for core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldInstanceTest.php: 2 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -64,12 +64,10 @@ public function testUserProfileFields() { $this->assertIdentical('Favorite bands', $field->label()); $this->assertIdentical("Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites.", $field->getDescription()); /* // Migrated URL field. $field = FieldConfig::load('user.user.profile_blog'); $this->assertIdentical('Your blog', $field->label()); $this->assertIdentical("Paste the full URL, $field->getDescription(), including http://, of your personal blog."); */ $this->assertIdentical('Blog', $field->label()); $this->assertIdentical("Paste the full URL, including http://, of your personal blog.", $field->getDescription()); // Migrated date field. $field = FieldConfig::load('user.user.profile_birthdate'); Loading
core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldTest.php +0 −2 Changes for core/modules/user/src/Tests/Migrate/MigrateUserProfileFieldTest.php: 0 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -64,11 +64,9 @@ public function testUserProfileFields() { $this->assertIdentical('text', $field_storage->getType(), 'Field type is text.'); $this->assertIdentical(-1, $field_storage->getCardinality(), 'List field has correct cardinality'); /* // Migrated URL field. $field_storage = FieldStorageConfig::load('user.profile_blog'); $this->assertIdentical('link', $field_storage->getType(), 'Field type is link.'); */ // Migrated date field. $field_storage = FieldStorageConfig::load('user.profile_birthdate'); Loading