/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test', 'type' => 'text'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_two', 'type' => 'integer', 'cardinality' => -1))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_two', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_three', 'type' => 'decimal'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_three', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_integer_selectlist', 'type' => 'integer'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_integer_selectlist', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_exclude_unset', 'type' => 'text'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_exclude_unset', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_multivalue', 'type' => 'decimal', 'precision' => '10', 'scale' => '2', 'cardinality' => -1))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_multivalue', 'bundle' => 'test_planet'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_identical1', 'type' => 'integer'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_identical1', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_identical2', 'type' => 'integer'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_identical2', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_link', 'type' => 'link'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_link', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_filefield', 'type' => 'file'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_filefield', 'bundle' => 'story'))->save();
     // Add some id mappings for the dependant migrations.
     $id_mappings = array('d6_field_formatter_settings' => array(array(array('page', 'default', 'node', 'field_test'), array('node', 'page', 'default', 'field_test'))), 'd6_field_instance_widget_settings' => array(array(array('page', 'field_test'), array('node', 'page', 'default', 'test'))), 'd6_node' => array(array(array(1), array(1)), array(array(2), array(2)), array(array(3), array(3))));
     $this->prepareMigrations($id_mappings);
     $migrations = entity_load_multiple('migration', array('d6_cck_field_values:*'));
     foreach ($migrations as $migration) {
         $executable = new MigrateExecutable($migration, $this);
         $executable->import();
     }
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migration = entity_load('migration', 'd6_node');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
     // This is required for the second import below.
     db_truncate($migration->getIdMap()->mapTableName())->execute();
     $this->standalone = TRUE;
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $id_mappings = array('d6_node' => array(array(array(1), array(1))));
     $this->prepareIdMappings($id_mappings);
     $dumps = array($this->getDumpDirectory() . '/Drupal6NodeRevision.php');
     $this->loadDumps($dumps);
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migration = entity_load('migration', 'd6_node_revision');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test', 'type' => 'text'))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test', 'bundle' => 'story'))->save();
     entity_create('field_storage_config', array('entity_type' => 'node', 'field_name' => 'field_test_two', 'type' => 'integer', 'cardinality' => -1))->save();
     entity_create('field_config', array('entity_type' => 'node', 'field_name' => 'field_test_two', 'bundle' => 'story'))->save();
     // Add some id mappings for the dependant migrations.
     $id_mappings = array('d6_cck_field_values' => array(array(array(1), array(1))), 'd6_node' => array(array(array(1), array(1)), array(array(2), array(2))), 'd6_node_revision' => array(array(array(1), array(1))));
     $this->prepareMigrations($id_mappings);
     $migrations = entity_load_multiple('migration', array('d6_cck_field_revision:*'));
     foreach ($migrations as $migration) {
         $executable = new MigrateExecutable($migration, $this);
         $executable->import();
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create our users for the node authors.
     foreach (Drupal6User::getData('users') as $u) {
         $user = entity_create('user', $u);
         $user->enforceIsNew();
         $user->save();
     }
     $id_mappings = array('d6_node' => array(array(array(1), array(1))));
     $this->prepareMigrations($id_mappings);
     $dumps = array($this->getDumpDirectory() . '/Drupal6NodeRevision.php');
     $this->loadDumps($dumps);
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migration = entity_load('migration', 'd6_node_revision');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $id_mappings = array('d6_node' => array(array(array(1), array(1))));
     $this->prepareMigrations($id_mappings);
     $dumps = array($this->getDumpDirectory() . '/Users.php');
     $this->loadDumps($dumps);
     // Create our users for the node authors.
     $query = Database::getConnection('default', 'migrate')->query('SELECT * FROM {users} WHERE uid NOT IN (0, 1)');
     while (($row = $query->fetchAssoc()) !== FALSE) {
         $user = entity_create('user', $row);
         $user->enforceIsNew();
         $user->save();
     }
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migration = entity_load('migration', 'd6_node_revision');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }