Issue #2346039 by ultimike, benjy: Add missing migrations to MigrateDrupal6Test and fix the result

8.0.x
Alex Pott 2014-11-24 12:08:02 +00:00
parent 3827a4815c
commit e789deca2a
7 changed files with 218 additions and 10 deletions

View File

@ -14,3 +14,6 @@ process:
default_value: 'options/promote' default_value: 'options/promote'
destination: destination:
plugin: entity:base_field_override plugin: entity:base_field_override
migration_dependencies:
required:
- d6_node_type

View File

@ -14,3 +14,6 @@ process:
default_value: 'options/status' default_value: 'options/status'
destination: destination:
plugin: entity:base_field_override plugin: entity:base_field_override
migration_dependencies:
required:
- d6_node_type

View File

@ -14,3 +14,6 @@ process:
default_value: 'options/sticky' default_value: 'options/sticky'
destination: destination:
plugin: entity:base_field_override plugin: entity:base_field_override
migration_dependencies:
required:
- d6_node_type

View File

@ -200,6 +200,91 @@ class Drupal6Node extends Drupal6DumpBase {
'tnid' => 0, 'tnid' => 0,
'translate' => 0, 'translate' => 0,
)) ))
->values(array(
'nid' => 4,
'vid' => 6,
'type' => 'test_planet',
'language' => '',
'title' => '',
'uid' => 1,
'status' => 1,
'created' => 1388271527,
'changed' => 1390096401,
'comment' => 0,
'promote' => 0,
'moderate' => 0,
'sticky' => 0,
'tnid' => 0,
'translate' => 0,
))
->values(array(
'nid' => 5,
'vid' => 7,
'type' => 'test_planet',
'language' => '',
'title' => '',
'uid' => 1,
'status' => 1,
'created' => 1388271527,
'changed' => 1390096401,
'comment' => 0,
'promote' => 0,
'moderate' => 0,
'sticky' => 0,
'tnid' => 0,
'translate' => 0,
))
->values(array(
'nid' => 6,
'vid' => 8,
'type' => 'test_planet',
'language' => '',
'title' => '',
'uid' => 1,
'status' => 1,
'created' => 1388271527,
'changed' => 1390096401,
'comment' => 0,
'promote' => 0,
'moderate' => 0,
'sticky' => 0,
'tnid' => 0,
'translate' => 0,
))
->values(array(
'nid' => 7,
'vid' => 9,
'type' => 'test_planet',
'language' => '',
'title' => '',
'uid' => 1,
'status' => 1,
'created' => 1388271527,
'changed' => 1390096401,
'comment' => 0,
'promote' => 0,
'moderate' => 0,
'sticky' => 0,
'tnid' => 0,
'translate' => 0,
))
->values(array(
'nid' => 8,
'vid' => 10,
'type' => 'test_planet',
'language' => '',
'title' => '',
'uid' => 1,
'status' => 1,
'created' => 1388271527,
'changed' => 1390096401,
'comment' => 0,
'promote' => 0,
'moderate' => 0,
'sticky' => 0,
'tnid' => 0,
'translate' => 0,
))
->execute(); ->execute();
$this->createTable('node_revisions', array( $this->createTable('node_revisions', array(
'description' => 'Stores information about each saved version of a {node}.', 'description' => 'Stores information about each saved version of a {node}.',
@ -313,6 +398,72 @@ class Drupal6Node extends Drupal6DumpBase {
'timestamp' => 1390095701, 'timestamp' => 1390095701,
'format' => 0, 'format' => 0,
)) ))
->values(array(
'nid' => 4,
'vid' => 6,
'uid' => 1,
'title' => 'Node 4',
'body' => 'Node 4 body',
'teaser' => 'test for node 4',
'log' => '',
'timestamp' => 1390095701,
'format' => 1,
))
->values(array(
'nid' => 5,
'vid' => 7,
'uid' => 1,
'title' => 'Node 5',
'body' => 'Node 5 body',
'teaser' => 'test for node 5',
'log' => '',
'timestamp' => 1390095701,
'format' => 1,
))
->values(array(
'nid' => 6,
'vid' => 8,
'uid' => 1,
'title' => 'Node 6',
'body' => 'Node 6 body',
'teaser' => 'test for node 6',
'log' => '',
'timestamp' => 1390095701,
'format' => 1,
))
->values(array(
'nid' => 7,
'vid' => 9,
'uid' => 1,
'title' => 'Node 7',
'body' => 'Node 7 body',
'teaser' => 'test for node 7',
'log' => '',
'timestamp' => 1390095701,
'format' => 1,
))
->values(array(
'nid' => 8,
'vid' => 10,
'uid' => 1,
'title' => 'Node 8',
'body' => 'Node 8 body',
'teaser' => 'test for node 8',
'log' => '',
'timestamp' => 1390095701,
'format' => 1,
))
->values(array(
'nid' => 9,
'vid' => 11,
'uid' => 1,
'title' => 'Node 9',
'body' => 'Node 9 body',
'teaser' => 'test for node 9',
'log' => '',
'timestamp' => 1390095701,
'format' => 1,
))
->execute(); ->execute();
$this->createTable('content_type_story', array( $this->createTable('content_type_story', array(
@ -417,6 +568,30 @@ class Drupal6Node extends Drupal6DumpBase {
'nid' => 3, 'nid' => 3,
'vid' => 4, 'vid' => 4,
)) ))
->values(array(
'nid' => 4,
'vid' => 6,
))
->values(array(
'nid' => 5,
'vid' => 7,
))
->values(array(
'nid' => 6,
'vid' => 8,
))
->values(array(
'nid' => 7,
'vid' => 9,
))
->values(array(
'nid' => 8,
'vid' => 10,
))
->values(array(
'nid' => 9,
'vid' => 11,
))
->execute(); ->execute();
} }
} }

View File

@ -29,6 +29,7 @@ class MigrateBookTest extends MigrateDrupalTestBase {
for ($i = 4; $i <= 8; $i++) { for ($i = 4; $i <= 8; $i++) {
$entity = entity_create('node', array( $entity = entity_create('node', array(
'type' => 'story', 'type' => 'story',
'title' => "Node $i",
'nid' => $i, 'nid' => $i,
'status' => TRUE, 'status' => TRUE,
)); ));
@ -69,12 +70,12 @@ class MigrateBookTest extends MigrateDrupalTestBase {
$this->assertEqual($nodes[8]->book['pid'], 0); $this->assertEqual($nodes[8]->book['pid'], 0);
$tree = \Drupal::service('book.manager')->bookTreeAllData(4); $tree = \Drupal::service('book.manager')->bookTreeAllData(4);
$this->assertEqual($tree['49990 4']['link']['nid'], 4); $this->assertEqual($tree['49990 Node 4 4']['link']['nid'], 4);
$this->assertEqual($tree['49990 4']['below']['50000 5']['link']['nid'], 5); $this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid'], 5);
$this->assertEqual($tree['49990 4']['below']['50000 5']['below']['50000 6']['link']['nid'], 6); $this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid'], 6);
$this->assertEqual($tree['49990 4']['below']['50000 5']['below']['50000 7']['link']['nid'], 7); $this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid'], 7);
$this->assertIdentical($tree['49990 4']['below']['50000 5']['below']['50000 6']['below'], array()); $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below'], array());
$this->assertIdentical($tree['49990 4']['below']['50000 5']['below']['50000 7']['below'], array()); $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below'], array());
} }
} }

View File

@ -61,6 +61,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_aggregator_feed', 'd6_aggregator_feed',
'd6_aggregator_item', 'd6_aggregator_item',
'd6_block', 'd6_block',
'd6_book',
'd6_book_settings', 'd6_book_settings',
'd6_cck_field_values:*', 'd6_cck_field_values:*',
'd6_cck_field_revision:*', 'd6_cck_field_revision:*',
@ -89,6 +90,9 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_menu', 'd6_menu',
'd6_menu_links', 'd6_menu_links',
'd6_node_revision', 'd6_node_revision',
'd6_node_setting_promote',
'd6_node_setting_status',
'd6_node_setting_sticky',
'd6_node', 'd6_node',
'd6_node_settings', 'd6_node_settings',
'd6_node_type', 'd6_node_type',
@ -103,6 +107,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_system_filter', 'd6_system_filter',
'd6_system_image', 'd6_system_image',
'd6_system_image_gd', 'd6_system_image_gd',
'd6_system_logging',
'd6_system_maintenance', 'd6_system_maintenance',
'd6_system_performance', 'd6_system_performance',
'd6_system_rss', 'd6_system_rss',
@ -121,6 +126,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_upload', 'd6_upload',
'd6_url_alias', 'd6_url_alias',
'd6_user_mail', 'd6_user_mail',
'd6_user_contact_settings',
'd6_user_profile_field_instance', 'd6_user_profile_field_instance',
'd6_user_profile_entity_display', 'd6_user_profile_entity_display',
'd6_user_profile_entity_form_display', 'd6_user_profile_entity_form_display',
@ -162,6 +168,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
$tests_path . '/Drupal6AggregatorItem.php', $tests_path . '/Drupal6AggregatorItem.php',
$tests_path . '/Drupal6AggregatorSettings.php', $tests_path . '/Drupal6AggregatorSettings.php',
$tests_path . '/Drupal6Block.php', $tests_path . '/Drupal6Block.php',
$tests_path . '/Drupal6Book.php',
$tests_path . '/Drupal6BookSettings.php', $tests_path . '/Drupal6BookSettings.php',
$tests_path . '/Drupal6Box.php', $tests_path . '/Drupal6Box.php',
$tests_path . '/Drupal6Comment.php', $tests_path . '/Drupal6Comment.php',
@ -179,8 +186,8 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
$tests_path . '/Drupal6Menu.php', $tests_path . '/Drupal6Menu.php',
$tests_path . '/Drupal6MenuLink.php', $tests_path . '/Drupal6MenuLink.php',
$tests_path . '/Drupal6MenuSettings.php', $tests_path . '/Drupal6MenuSettings.php',
$tests_path . '/Drupal6NodeBodyInstance.php',
$tests_path . '/Drupal6Node.php', $tests_path . '/Drupal6Node.php',
$tests_path . '/Drupal6NodeBodyInstance.php',
$tests_path . '/Drupal6NodeRevision.php', $tests_path . '/Drupal6NodeRevision.php',
$tests_path . '/Drupal6NodeSettings.php', $tests_path . '/Drupal6NodeSettings.php',
$tests_path . '/Drupal6NodeType.php', $tests_path . '/Drupal6NodeType.php',
@ -194,8 +201,9 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
// where the files are. // where the files are.
$tests_path . '/Drupal6SystemFile.php', $tests_path . '/Drupal6SystemFile.php',
$tests_path . '/Drupal6SystemFilter.php', $tests_path . '/Drupal6SystemFilter.php',
$tests_path . '/Drupal6SystemImageGd.php',
$tests_path . '/Drupal6SystemImage.php', $tests_path . '/Drupal6SystemImage.php',
$tests_path . '/Drupal6SystemImageGd.php',
$tests_path . '/Drupal6SystemLogging.php',
$tests_path . '/Drupal6SystemMaintenance.php', $tests_path . '/Drupal6SystemMaintenance.php',
$tests_path . '/Drupal6SystemPerformance.php', $tests_path . '/Drupal6SystemPerformance.php',
$tests_path . '/Drupal6SystemRss.php', $tests_path . '/Drupal6SystemRss.php',
@ -206,11 +214,12 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
$tests_path . '/Drupal6TermNode.php', $tests_path . '/Drupal6TermNode.php',
$tests_path . '/Drupal6TextSettings.php', $tests_path . '/Drupal6TextSettings.php',
$tests_path . '/Drupal6UpdateSettings.php', $tests_path . '/Drupal6UpdateSettings.php',
$tests_path . '/Drupal6UploadInstance.php',
$tests_path . '/Drupal6Upload.php', $tests_path . '/Drupal6Upload.php',
$tests_path . '/Drupal6UploadField.php',
$tests_path . '/Drupal6UploadInstance.php',
$tests_path . '/Drupal6UrlAlias.php', $tests_path . '/Drupal6UrlAlias.php',
$tests_path . '/Drupal6UserMail.php',
$tests_path . '/Drupal6User.php', $tests_path . '/Drupal6User.php',
$tests_path . '/Drupal6UserMail.php',
$tests_path . '/Drupal6UserProfileFields.php', $tests_path . '/Drupal6UserProfileFields.php',
$tests_path . '/Drupal6UserRole.php', $tests_path . '/Drupal6UserRole.php',
$tests_path . '/Drupal6UserSettings.php', $tests_path . '/Drupal6UserSettings.php',
@ -230,6 +239,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
__NAMESPACE__ . '\MigrateAggregatorFeedTest', __NAMESPACE__ . '\MigrateAggregatorFeedTest',
__NAMESPACE__ . '\MigrateAggregatorItemTest', __NAMESPACE__ . '\MigrateAggregatorItemTest',
__NAMESPACE__ . '\MigrateBlockTest', __NAMESPACE__ . '\MigrateBlockTest',
__NAMESPACE__ . '\MigrateBookTest',
__NAMESPACE__ . '\MigrateBookConfigsTest', __NAMESPACE__ . '\MigrateBookConfigsTest',
__NAMESPACE__ . '\MigrateCckFieldValuesTest', __NAMESPACE__ . '\MigrateCckFieldValuesTest',
__NAMESPACE__ . '\MigrateCckFieldRevisionTest', __NAMESPACE__ . '\MigrateCckFieldRevisionTest',
@ -257,6 +267,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
__NAMESPACE__ . '\MigrateMenuConfigsTest', __NAMESPACE__ . '\MigrateMenuConfigsTest',
__NAMESPACE__ . '\MigrateMenuLinkTest', __NAMESPACE__ . '\MigrateMenuLinkTest',
__NAMESPACE__ . '\MigrateMenuTest', __NAMESPACE__ . '\MigrateMenuTest',
__NAMESPACE__ . '\MigrateNodeBundleSettingsTest',
__NAMESPACE__ . '\MigrateNodeConfigsTest', __NAMESPACE__ . '\MigrateNodeConfigsTest',
__NAMESPACE__ . '\MigrateNodeRevisionTest', __NAMESPACE__ . '\MigrateNodeRevisionTest',
__NAMESPACE__ . '\MigrateNodeTest', __NAMESPACE__ . '\MigrateNodeTest',
@ -272,6 +283,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
__NAMESPACE__ . '\MigrateSystemFilterTest', __NAMESPACE__ . '\MigrateSystemFilterTest',
__NAMESPACE__ . '\MigrateSystemImageGdTest', __NAMESPACE__ . '\MigrateSystemImageGdTest',
__NAMESPACE__ . '\MigrateSystemImageTest', __NAMESPACE__ . '\MigrateSystemImageTest',
__NAMESPACE__ . '\MigrateSystemLoggingTest',
__NAMESPACE__ . '\MigrateSystemMaintenanceTest', __NAMESPACE__ . '\MigrateSystemMaintenanceTest',
__NAMESPACE__ . '\MigrateSystemPerformanceTest', __NAMESPACE__ . '\MigrateSystemPerformanceTest',
__NAMESPACE__ . '\MigrateSystemRssTest', __NAMESPACE__ . '\MigrateSystemRssTest',
@ -290,6 +302,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
__NAMESPACE__ . '\MigrateUploadTest', __NAMESPACE__ . '\MigrateUploadTest',
__NAMESPACE__ . '\MigrateUrlAliasTest', __NAMESPACE__ . '\MigrateUrlAliasTest',
__NAMESPACE__ . '\MigrateUserConfigsTest', __NAMESPACE__ . '\MigrateUserConfigsTest',
__NAMESPACE__ . '\MigrateUserContactSettingsTest',
__NAMESPACE__ . '\MigrateUserProfileEntityDisplayTest', __NAMESPACE__ . '\MigrateUserProfileEntityDisplayTest',
__NAMESPACE__ . '\MigrateUserProfileEntityFormDisplayTest', __NAMESPACE__ . '\MigrateUserProfileEntityFormDisplayTest',
__NAMESPACE__ . '\MigrateUserProfileFieldTest', __NAMESPACE__ . '\MigrateUserProfileFieldTest',

View File

@ -37,6 +37,16 @@ class MigrateNodeBundleSettingsTest extends MigrateDrupalTestBase {
entity_create('node_type', array('type' => 'test_event'))->save(); entity_create('node_type', array('type' => 'test_event'))->save();
entity_create('node_type', array('type' => 'story'))->save(); entity_create('node_type', array('type' => 'story'))->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. // Setup the dumps.
$migration = entity_load('migration', 'd6_node_setting_promote'); $migration = entity_load('migration', 'd6_node_setting_promote');