diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php index 8eb95b6..69dc0eb 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php @@ -9,7 +9,7 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; -use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; +use Drupal\Core\Database\Database; /** * Tests the user profile entity display migration. @@ -73,17 +73,6 @@ protected function setUp() { 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); - $field_data = Drupal6UserProfileFields::getData('profile_fields'); - 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(); - } $migration = entity_load('migration', 'd6_user_profile_entity_display'); $dumps = array( @@ -94,6 +83,21 @@ protected function setUp() { $this->getDumpDirectory() . '/EventTimezones.php', ); $this->prepare($migration, $dumps); + $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(); + } $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php index ed9a5dc..a92ce81 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php @@ -9,7 +9,7 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; -use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; +use Drupal\Core\Database\Database; /** * Tests the user profile entity form display migration. @@ -68,17 +68,6 @@ protected function setUp() { 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); - $field_data = Drupal6UserProfileFields::getData('profile_fields'); - 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(); - } $migration = entity_load('migration', 'd6_user_profile_entity_form_display'); $dumps = array( @@ -89,6 +78,23 @@ protected function setUp() { $this->getDumpDirectory() . '/EventTimezones.php', ); $this->prepare($migration, $dumps); + + $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(); + } + $executable = new MigrateExecutable($migration, $this); $executable->import(); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php index 65a1e42..465b6d5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php @@ -9,7 +9,6 @@ use Drupal\migrate\MigrateExecutable; use Drupal\Core\Database\Database; -use Drupal\migrate_drupal\Tests\Dump\Drupal6UserProfileFields; use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; use Drupal\user\Entity\User; @@ -88,18 +87,6 @@ protected function setUp() { 'type' => 'boolean', ))->save(); - // Create the field instances. - foreach (Drupal6UserProfileFields::getData('profile_fields') as $field) { - entity_create('field_config', array( - 'label' => $field['title'], - 'description' => '', - 'field_name' => $field['name'], - 'entity_type' => 'user', - 'bundle' => 'user', - 'required' => 0, - ))->save(); - } - // Add some id mappings for the dependant migrations. $id_mappings = array( 'd6_user_profile_field_instance' => array( @@ -128,6 +115,22 @@ protected function setUp() { $this->getDumpDirectory() . '/EventTimezones.php', ); $this->loadDumps($dumps); + $field_data = Database::getConnection('default', 'migrate') + ->select('profile_fields', 'u') + ->fields('u') + ->execute() + ->fetchAll(); + // Create the field instances. + foreach ($field_data as $field) { + entity_create('field_config', array( + 'label' => $field->title, + 'description' => '', + 'field_name' => $field->name, + 'entity_type' => 'user', + 'bundle' => 'user', + 'required' => 0, + ))->save(); + } // Create our users for the node authors. $query = Database::getConnection('default', 'migrate')->query('SELECT * FROM {users} WHERE uid NOT IN (0, 1)');