/**
  * {@inheritdoc}
  */
 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', 'settings' => array('allowed_values' => array('Pill spammers' => 'Pill spammers', 'Fitness spammers' => 'Fitness spammers'))))->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();
     // Add some id mappings for the dependant migrations.
     $id_mappings = array('d6_user_profile_field_instance' => array(array(array(1), array('user', 'user', 'fieldname'))), 'd6_user_profile_entity_display' => array(array(array(1), array('user', 'user', 'default', 'fieldname'))), 'd6_user_profile_entity_form_display' => array(array(array(1), array('user', 'user', 'default', 'fieldname'))), 'd6_user' => array(array(array(2), array(2)), array(array(8), array(8)), array(array(15), array(15))));
     $this->prepareMigrations($id_mappings);
     // Load database dumps to provide source data.
     $dumps = array($this->getDumpDirectory() . '/ProfileFields.php', $this->getDumpDirectory() . '/Users.php', $this->getDumpDirectory() . '/ProfileValues.php', $this->getDumpDirectory() . '/UsersRoles.php', $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)');
     while (($row = $query->fetchAssoc()) !== FALSE) {
         $user = entity_create('user', $row);
         $user->enforceIsNew();
         $user->save();
     }
     // Migrate profile fields.
     $migration_format = entity_load('migration', 'd6_profile_values:user');
     $executable = new MigrateExecutable($migration_format, $this);
     $executable->import();
 }
Example #2
0
 /**
  * Test node migration from Drupal 6 to 8.
  */
 public function testNode()
 {
     $node = node_load(1);
     $this->assertEqual($node->id(), 1, 'Node 1 loaded.');
     $this->assertEqual($node->body->value, 'test');
     $this->assertEqual($node->body->format, 'filtered_html');
     $this->assertEqual($node->getType(), 'story', 'Node has the correct bundle.');
     $this->assertEqual($node->getTitle(), 'Test title', 'Node has the correct title.');
     $this->assertEqual($node->getCreatedTime(), 1388271197, 'Node has the correct created time.');
     $this->assertEqual($node->isSticky(), FALSE);
     $this->assertEqual($node->getOwnerId(), 1);
     //$this->assertEqual($node->getRevisionCreationTime(), 1390095701, 'Node has the correct revision timestamp.');
     // It is pointless to run the second half from MigrateDrupal6Test.
     if (empty($this->standalone)) {
         return;
     }
     // Test that we can re-import using the EntityContentBase destination.
     $connection = Database::getConnection('default', 'migrate');
     $connection->update('node_revisions')->fields(array('title' => 'New node title', 'format' => 2))->condition('vid', 1)->execute();
     $connection->delete('content_field_test_two')->condition('delta', 1)->execute();
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migration = entity_load('migration', 'd6_node');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
     $node = node_load(1);
     $this->assertEqual($node->getTitle(), 'New node title');
     // Test a multi-column fields are correctly upgraded.
     $this->assertEqual($node->body->value, 'test');
     $this->assertEqual($node->body->format, 'full_html');
 }
 /**
  * Tests rolling back configuration and content entities.
  */
 public function testRollback()
 {
     // We use vocabularies to demonstrate importing and rolling back
     // configuration entities.
     $vocabulary_data_rows = [['id' => '1', 'name' => 'categories', 'weight' => '2'], ['id' => '2', 'name' => 'tags', 'weight' => '1']];
     $ids = ['id' => ['type' => 'integer']];
     $config = ['id' => 'vocabularies', 'migration_tags' => ['Import and rollback test'], 'source' => ['plugin' => 'embedded_data', 'data_rows' => $vocabulary_data_rows, 'ids' => $ids], 'process' => ['vid' => 'id', 'name' => 'name', 'weight' => 'weight'], 'destination' => ['plugin' => 'entity:taxonomy_vocabulary']];
     $vocabulary_migration = Migration::create($config);
     $vocabulary_id_map = $vocabulary_migration->getIdMap();
     $this->assertTrue($vocabulary_migration->getDestinationPlugin()->supportsRollback());
     // Import and validate vocabulary config entities were created.
     $vocabulary_executable = new MigrateExecutable($vocabulary_migration, $this);
     $vocabulary_executable->import();
     foreach ($vocabulary_data_rows as $row) {
         /** @var Vocabulary $vocabulary */
         $vocabulary = Vocabulary::load($row['id']);
         $this->assertTrue($vocabulary);
         $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]);
         $this->assertNotNull($map_row['destid1']);
     }
     // We use taxonomy terms to demonstrate importing and rolling back
     // content entities.
     $term_data_rows = [['id' => '1', 'vocab' => '1', 'name' => 'music'], ['id' => '2', 'vocab' => '2', 'name' => 'Bach'], ['id' => '3', 'vocab' => '2', 'name' => 'Beethoven']];
     $ids = ['id' => ['type' => 'integer']];
     $config = ['id' => 'terms', 'migration_tags' => ['Import and rollback test'], 'source' => ['plugin' => 'embedded_data', 'data_rows' => $term_data_rows, 'ids' => $ids], 'process' => ['tid' => 'id', 'vid' => 'vocab', 'name' => 'name'], 'destination' => ['plugin' => 'entity:taxonomy_term'], 'migration_dependencies' => ['required' => ['vocabularies']]];
     $term_migration = Migration::create($config);
     $term_id_map = $term_migration->getIdMap();
     $this->assertTrue($term_migration->getDestinationPlugin()->supportsRollback());
     // Import and validate term entities were created.
     $term_executable = new MigrateExecutable($term_migration, $this);
     $term_executable->import();
     foreach ($term_data_rows as $row) {
         /** @var Term $term */
         $term = Term::load($row['id']);
         $this->assertTrue($term);
         $map_row = $term_id_map->getRowBySource(['id' => $row['id']]);
         $this->assertNotNull($map_row['destid1']);
     }
     // Rollback and verify the entities are gone.
     $term_executable->rollback();
     foreach ($term_data_rows as $row) {
         $term = Term::load($row['id']);
         $this->assertNull($term);
         $map_row = $term_id_map->getRowBySource(['id' => $row['id']]);
         $this->assertFalse($map_row);
     }
     $vocabulary_executable->rollback();
     foreach ($vocabulary_data_rows as $row) {
         $term = Vocabulary::load($row['id']);
         $this->assertNull($term);
         $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]);
         $this->assertFalse($map_row);
     }
     // Test that simple configuration is not rollbackable.
     $term_setting_rows = [['id' => 1, 'override_selector' => '0', 'terms_per_page_admin' => '10']];
     $ids = ['id' => ['type' => 'integer']];
     $config = ['id' => 'taxonomy_settings', 'migration_tags' => ['Import and rollback test'], 'source' => ['plugin' => 'embedded_data', 'data_rows' => $term_setting_rows, 'ids' => $ids], 'process' => ['override_selector' => 'override_selector', 'terms_per_page_admin' => 'terms_per_page_admin'], 'destination' => ['plugin' => 'config', 'config_name' => 'taxonomy.settings'], 'migration_dependencies' => ['required' => ['vocabularies']]];
     $settings_migration = Migration::create($config);
     $this->assertFalse($settings_migration->getDestinationPlugin()->supportsRollback());
 }
 /**
  * Tests creation of stubs when weight is mapped.
  */
 public function testStubWithWeightMapping()
 {
     // Create a vocabulary via migration for the terms to reference.
     $vocabulary_data_rows = [['id' => '1', 'name' => 'tags']];
     $ids = ['id' => ['type' => 'integer']];
     $config = ['id' => 'vocabularies', 'migration_tags' => ['Stub test'], 'source' => ['plugin' => 'embedded_data', 'data_rows' => $vocabulary_data_rows, 'ids' => $ids], 'process' => ['vid' => 'id', 'name' => 'name'], 'destination' => ['plugin' => 'entity:taxonomy_vocabulary']];
     $vocabulary_migration = Migration::create($config);
     $vocabulary_executable = new MigrateExecutable($vocabulary_migration, $this);
     $vocabulary_executable->import();
     // We have a term referencing an unmigrated parent, forcing a stub to be
     // created.
     $term_data_rows = [['id' => '1', 'vocab' => '1', 'name' => 'music', 'parent' => '2']];
     $ids = ['id' => ['type' => 'integer']];
     $config = ['id' => 'terms', 'migration_tags' => ['Import and rollback test'], 'source' => ['plugin' => 'embedded_data', 'data_rows' => $term_data_rows, 'ids' => $ids], 'process' => ['tid' => 'id', 'vid' => 'vocab', 'name' => 'name', 'weight' => 'weight', 'parent' => ['plugin' => 'migration', 'migration' => 'terms', 'source' => 'parent']], 'destination' => ['plugin' => 'entity:taxonomy_term'], 'migration_dependencies' => ['required' => ['vocabularies']]];
     $term_migration = Migration::create($config);
     $term_migration->save();
     $term_executable = new MigrateExecutable($term_migration, $this);
     $term_executable->import();
     // Load the referenced term, which should exist as a stub.
     /** @var \Drupal\Core\Entity\ContentEntityBase $stub_entity */
     $stub_entity = Term::load(2);
     $this->assertTrue($stub_entity, 'Stub successfully created');
     if ($stub_entity) {
         $this->assertIdentical(count($stub_entity->validate()), 0, 'Stub is a valid entity');
     }
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('file');
     $this->installSchema('file', ['file_usage']);
     // Create the user profile field and instance.
     entity_create('field_storage_config', array('entity_type' => 'user', 'field_name' => 'user_picture', 'type' => 'image', 'translatable' => '0'))->save();
     entity_create('field_config', array('label' => 'User Picture', 'description' => '', 'field_name' => 'user_picture', 'entity_type' => 'user', 'bundle' => 'user', 'required' => 0))->save();
     $file = entity_create('file', array('fid' => 2, 'uid' => 2, 'filename' => 'image-test.jpg', 'uri' => "public://image-test.jpg", 'filemime' => 'image/jpeg', 'created' => 1, 'changed' => 1, 'status' => FILE_STATUS_PERMANENT));
     $file->enforceIsNew();
     file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-1.png'));
     $file->save();
     $file = entity_create('file', array('fid' => 8, 'uid' => 8, 'filename' => 'image-test.png', 'uri' => "public://image-test.png", 'filemime' => 'image/png', 'created' => 1, 'changed' => 1, 'status' => FILE_STATUS_PERMANENT));
     $file->enforceIsNew();
     file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-2.jpg'));
     $file->save();
     // Load database dumps to provide source data.
     $dumps = array($this->getDumpDirectory() . '/Filters.php', $this->getDumpDirectory() . '/FilterFormats.php', $this->getDumpDirectory() . '/Variable.php', $this->getDumpDirectory() . '/ProfileFields.php', $this->getDumpDirectory() . '/Permission.php', $this->getDumpDirectory() . '/Role.php', $this->getDumpDirectory() . '/Users.php', $this->getDumpDirectory() . '/ProfileValues.php', $this->getDumpDirectory() . '/UsersRoles.php', $this->getDumpDirectory() . '/EventTimezones.php');
     $this->loadDumps($dumps);
     $id_mappings = array('d6_user_role' => array(array(array(1), array('anonymous user')), array(array(2), array('authenticated user')), array(array(3), array('migrate test role 1')), array(array(4), array('migrate test role 2')), array(array(5), array('migrate test role 3'))), 'd6_user_picture_entity_display' => array(array(array(1), array('user', 'user', 'default', 'user_picture'))), 'd6_user_picture_entity_form_display' => array(array(array(1), array('user', 'user', 'default', 'user_picture'))), 'd6_user_picture_file' => array(array(array(2), array(2)), array(array(8), array(8))));
     $this->prepareMigrations($id_mappings);
     // Migrate users.
     $migration = entity_load('migration', 'd6_user');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 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', 'settings' => array('allowed_values' => array('Pill spammers' => 'Pill spammers', 'Fitness spammers' => 'Fitness spammers'))))->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();
     // 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();
     }
     // Create some users to migrate the profile data to.
     foreach (Drupal6User::getData('users') as $u) {
         $user = entity_create('user', $u);
         $user->enforceIsNew();
         $user->save();
     }
     // Add some id mappings for the dependant migrations.
     $id_mappings = array('d6_user_profile_field_instance' => array(array(array(1), array('user', 'user', 'fieldname'))), 'd6_user_profile_entity_display' => array(array(array(1), array('user', 'user', 'default', 'fieldname'))), 'd6_user_profile_entity_form_display' => array(array(array(1), array('user', 'user', 'default', 'fieldname'))), 'd6_user' => array(array(array(2), array(2)), array(array(8), array(8)), array(array(15), array(15))));
     $this->prepareMigrations($id_mappings);
     // Load database dumps to provide source data.
     $dumps = array($this->getDumpDirectory() . '/Drupal6UserProfileFields.php', $this->getDumpDirectory() . '/Drupal6User.php');
     $this->loadDumps($dumps);
     // Migrate profile fields.
     $migration_format = entity_load('migration', 'd6_profile_values:user');
     $executable = new MigrateExecutable($migration_format, $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();
     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();
     }
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     // Setup the bundles.
     entity_create('node_type', array('type' => 'test_page'))->save();
     entity_create('node_type', array('type' => 'test_planet'))->save();
     entity_create('node_type', array('type' => 'test_story'))->save();
     entity_create('node_type', array('type' => 'test_event'))->save();
     entity_create('node_type', array('type' => 'story'))->save();
     entity_create('node_type', array('type' => 'article'))->save();
     entity_create('node_type', array('type' => 'company'))->save();
     entity_create('node_type', array('type' => 'employee'))->save();
     entity_create('node_type', array('type' => 'page'))->save();
     entity_create('node_type', array('type' => 'sponsor'))->save();
     entity_create('node_type', array('type' => 'event'))->save();
     entity_create('node_type', array('type' => 'book'))->save();
     // Create a config entity that already exists.
     entity_create('base_field_override', array('field_name' => 'promote', 'entity_type' => 'node', 'bundle' => 'page'))->save();
     $id_mappings = array('d6_node_type' => array(array(array('test_page'), array('test_page')), array(array('test_planet'), array('test_planet')), array(array('test_story'), array('test_story')), array(array('test_event'), array('test_event')), array(array('story'), array('story'))));
     $this->prepareMigrations($id_mappings);
     // Setup the dumps.
     $migration = entity_load('migration', 'd6_node_setting_promote');
     $dumps = array($this->getDumpDirectory() . '/NodeType.php', $this->getDumpDirectory() . '/Variable.php');
     $this->prepare($migration, $dumps);
     // Run the migrations.
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
     $migration = entity_load('migration', 'd6_node_setting_status');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
     $migration = entity_load('migration', 'd6_node_setting_sticky');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_upload_field');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
Example #10
0
 /**
  * Tests the Drupal 6 files to Drupal 8 migration.
  */
 public function testFiles()
 {
     /** @var \Drupal\file\FileInterface $file */
     $file = entity_load('file', 1);
     $this->assertIdentical('Image1.png', $file->getFilename());
     $this->assertIdentical('39325', $file->getSize());
     $this->assertIdentical('public://image-1.png', $file->getFileUri());
     $this->assertIdentical('image/png', $file->getMimeType());
     // It is pointless to run the second half from MigrateDrupal6Test.
     if (empty($this->standalone)) {
         return;
     }
     // Test that we can re-import and also test with file_directory_path set.
     db_truncate(entity_load('migration', 'd6_file')->getIdMap()->mapTableName())->execute();
     $migration = entity_load_unchanged('migration', 'd6_file');
     $dumps = array($this->getDumpDirectory() . '/Variable.php');
     $this->prepare($migration, $dumps);
     // Update the file_directory_path.
     Database::getConnection('default', 'migrate')->update('variable')->fields(array('value' => serialize('files/test')))->condition('name', 'file_directory_path')->execute();
     Database::getConnection('default', 'migrate')->update('variable')->fields(array('value' => serialize($this->getTempFilesDirectory())))->condition('name', 'file_directory_temp')->execute();
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
     $file = entity_load('file', 2);
     $this->assertIdentical('public://core/modules/simpletest/files/image-2.jpg', $file->getFileUri());
     // Ensure that a temporary file has been migrated.
     $file = entity_load('file', 6);
     $this->assertIdentical('temporary://' . static::getUniqueFilename(), $file->getFileUri());
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_user_picture_field');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migration = entity_load('migration', 'd6_upload');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_syslog_settings');
     $dumps = array($this->getDumpDirectory() . '/Variable.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_contact_category');
     $dumps = array($this->getDumpDirectory() . '/Drupal6ContactCategory.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, new MigrateMessage());
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_user_mail');
     $dumps = array($this->getDumpDirectory() . '/Drupal6UserMail.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_user_profile_field');
     $dumps = array($this->getDumpDirectory() . '/ProfileFields.php', $this->getDumpDirectory() . '/Users.php', $this->getDumpDirectory() . '/ProfileValues.php', $this->getDumpDirectory() . '/UsersRoles.php', $this->getDumpDirectory() . '/EventTimezones.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_aggregator_settings');
     $dumps = array($this->getDumpDirectory() . '/Drupal6AggregatorSettings.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_filter_format');
     $dumps = array($this->getDumpDirectory() . '/Filters.php', $this->getDumpDirectory() . '/FilterFormats.php', $this->getDumpDirectory() . '/Variable.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
Example #19
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_view_modes');
     $dumps = array($this->getDumpDirectory() . '/ContentNodeFieldInstance.php', $this->getDumpDirectory() . '/ContentNodeField.php', $this->getDumpDirectory() . '/ContentFieldTest.php', $this->getDumpDirectory() . '/ContentFieldTestTwo.php', $this->getDumpDirectory() . '/ContentFieldMultivalue.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_taxonomy_vocabulary');
     $dumps = array($this->getDumpDirectory() . '/Vocabulary.php', $this->getDumpDirectory() . '/VocabularyNodeTypes.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
Example #21
0
 /**
  * Tests migration interruptions.
  */
 public function testMessagesTeed()
 {
     // Ask to receive any messages sent to the idmap.
     \Drupal::service('event_dispatcher')->addListener(MigrateEvents::IDMAP_MESSAGE, array($this, 'mapMessageRecorder'));
     $executable = new MigrateExecutable($this->migration, $this);
     $executable->import();
     $this->assertIdentical(count($this->messages), 1);
     $this->assertIdentical(reset($this->messages), "source_message: 'a message' is not an array");
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_file_settings');
     $dumps = array($this->getDumpDirectory() . '/Drupal6FileSettings.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, new MigrateMessage());
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $id_mappings = array('d6_user_picture_field_instance' => array(array(array(1), array('user', 'user', 'user_picture'))));
     $this->prepareMigrations($id_mappings);
     $migration = entity_load('migration', 'd6_user_picture_entity_form_display');
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
Example #24
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_node_type');
     $dumps = array($this->getDumpDirectory() . '/Drupal6NodeType.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_system_cron');
     $dumps = array($this->getDumpDirectory() . '/Drupal6SystemCron.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, new MigrateMessage());
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_filter_format');
     $dumps = array($this->getDumpDirectory() . '/Drupal6FilterFormat.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $migration = entity_load('migration', 'd6_view_modes');
     $dumps = array($this->getDumpDirectory() . '/Drupal6FieldInstance.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->prepareMigrations(array('d6_taxonomy_vocabulary' => array(array(array(1), array('vocabulary_1_i_0_')))));
     $migration = entity_load('migration', 'd6_forum_settings');
     $dumps = array($this->getDumpDirectory() . '/Variable.php');
     $this->prepare($migration, $dumps);
     $executable = new MigrateExecutable($migration, $this);
     $executable->import();
 }
Example #29
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var \Drupal\migrate\entity\Migration $migration */
     $migrations = entity_load_multiple('migration', array('d6_term_node:*'));
     foreach ($migrations as $migration) {
         $executable = new MigrateExecutable($migration, $this);
         $executable->import();
     }
 }
 /**
  * Tests dependencies on the migration of aggregator feeds & items.
  */
 public function testAggregatorMigrateDependencies()
 {
     /** @var \Drupal\migrate\Plugin\Migration $migration */
     $migration = $this->getMigration('d6_aggregator_item');
     $executable = new MigrateExecutable($migration, $this);
     $this->startCollectingMessages();
     $executable->import();
     $this->assertEqual($this->migrateMessages['error'], array(SafeMarkup::format('Migration @id did not meet the requirements. Missing migrations d6_aggregator_feed. requirements: d6_aggregator_feed.', array('@id' => $migration->id()))));
     $this->collectMessages = FALSE;
 }