Commit e789deca authored by alexpott's avatar alexpott

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

parent 3827a481
......@@ -14,3 +14,6 @@ process:
default_value: 'options/promote'
destination:
plugin: entity:base_field_override
migration_dependencies:
required:
- d6_node_type
......@@ -14,3 +14,6 @@ process:
default_value: 'options/status'
destination:
plugin: entity:base_field_override
migration_dependencies:
required:
- d6_node_type
......@@ -14,3 +14,6 @@ process:
default_value: 'options/sticky'
destination:
plugin: entity:base_field_override
migration_dependencies:
required:
- d6_node_type
......@@ -200,6 +200,91 @@ public function load() {
'tnid' => 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();
$this->createTable('node_revisions', array(
'description' => 'Stores information about each saved version of a {node}.',
......@@ -313,6 +398,72 @@ public function load() {
'timestamp' => 1390095701,
'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();
$this->createTable('content_type_story', array(
......@@ -417,6 +568,30 @@ public function load() {
'nid' => 3,
'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();
}
}
......@@ -29,6 +29,7 @@ protected function setUp() {
for ($i = 4; $i <= 8; $i++) {
$entity = entity_create('node', array(
'type' => 'story',
'title' => "Node $i",
'nid' => $i,
'status' => TRUE,
));
......@@ -69,12 +70,12 @@ public function testBook() {
$this->assertEqual($nodes[8]->book['pid'], 0);
$tree = \Drupal::service('book.manager')->bookTreeAllData(4);
$this->assertEqual($tree['49990 4']['link']['nid'], 4);
$this->assertEqual($tree['49990 4']['below']['50000 5']['link']['nid'], 5);
$this->assertEqual($tree['49990 4']['below']['50000 5']['below']['50000 6']['link']['nid'], 6);
$this->assertEqual($tree['49990 4']['below']['50000 5']['below']['50000 7']['link']['nid'], 7);
$this->assertIdentical($tree['49990 4']['below']['50000 5']['below']['50000 6']['below'], array());
$this->assertIdentical($tree['49990 4']['below']['50000 5']['below']['50000 7']['below'], array());
$this->assertEqual($tree['49990 Node 4 4']['link']['nid'], 4);
$this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid'], 5);
$this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid'], 6);
$this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid'], 7);
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below'], array());
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below'], array());
}
}
......@@ -61,6 +61,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_aggregator_feed',
'd6_aggregator_item',
'd6_block',
'd6_book',
'd6_book_settings',
'd6_cck_field_values:*',
'd6_cck_field_revision:*',
......@@ -89,6 +90,9 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_menu',
'd6_menu_links',
'd6_node_revision',
'd6_node_setting_promote',
'd6_node_setting_status',
'd6_node_setting_sticky',
'd6_node',
'd6_node_settings',
'd6_node_type',
......@@ -103,6 +107,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_system_filter',
'd6_system_image',
'd6_system_image_gd',
'd6_system_logging',
'd6_system_maintenance',
'd6_system_performance',
'd6_system_rss',
......@@ -121,6 +126,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
'd6_upload',
'd6_url_alias',
'd6_user_mail',
'd6_user_contact_settings',
'd6_user_profile_field_instance',
'd6_user_profile_entity_display',
'd6_user_profile_entity_form_display',
......@@ -162,6 +168,7 @@ protected function getDumps() {
$tests_path . '/Drupal6AggregatorItem.php',
$tests_path . '/Drupal6AggregatorSettings.php',
$tests_path . '/Drupal6Block.php',
$tests_path . '/Drupal6Book.php',
$tests_path . '/Drupal6BookSettings.php',
$tests_path . '/Drupal6Box.php',
$tests_path . '/Drupal6Comment.php',
......@@ -179,8 +186,8 @@ protected function getDumps() {
$tests_path . '/Drupal6Menu.php',
$tests_path . '/Drupal6MenuLink.php',
$tests_path . '/Drupal6MenuSettings.php',
$tests_path . '/Drupal6NodeBodyInstance.php',
$tests_path . '/Drupal6Node.php',
$tests_path . '/Drupal6NodeBodyInstance.php',
$tests_path . '/Drupal6NodeRevision.php',
$tests_path . '/Drupal6NodeSettings.php',
$tests_path . '/Drupal6NodeType.php',
......@@ -194,8 +201,9 @@ protected function getDumps() {
// where the files are.
$tests_path . '/Drupal6SystemFile.php',
$tests_path . '/Drupal6SystemFilter.php',
$tests_path . '/Drupal6SystemImageGd.php',
$tests_path . '/Drupal6SystemImage.php',
$tests_path . '/Drupal6SystemImageGd.php',
$tests_path . '/Drupal6SystemLogging.php',
$tests_path . '/Drupal6SystemMaintenance.php',
$tests_path . '/Drupal6SystemPerformance.php',
$tests_path . '/Drupal6SystemRss.php',
......@@ -206,11 +214,12 @@ protected function getDumps() {
$tests_path . '/Drupal6TermNode.php',
$tests_path . '/Drupal6TextSettings.php',
$tests_path . '/Drupal6UpdateSettings.php',
$tests_path . '/Drupal6UploadInstance.php',
$tests_path . '/Drupal6Upload.php',
$tests_path . '/Drupal6UploadField.php',
$tests_path . '/Drupal6UploadInstance.php',
$tests_path . '/Drupal6UrlAlias.php',
$tests_path . '/Drupal6UserMail.php',
$tests_path . '/Drupal6User.php',
$tests_path . '/Drupal6UserMail.php',
$tests_path . '/Drupal6UserProfileFields.php',
$tests_path . '/Drupal6UserRole.php',
$tests_path . '/Drupal6UserSettings.php',
......@@ -230,6 +239,7 @@ protected function getTestClassesList() {
__NAMESPACE__ . '\MigrateAggregatorFeedTest',
__NAMESPACE__ . '\MigrateAggregatorItemTest',
__NAMESPACE__ . '\MigrateBlockTest',
__NAMESPACE__ . '\MigrateBookTest',
__NAMESPACE__ . '\MigrateBookConfigsTest',
__NAMESPACE__ . '\MigrateCckFieldValuesTest',
__NAMESPACE__ . '\MigrateCckFieldRevisionTest',
......@@ -257,6 +267,7 @@ protected function getTestClassesList() {
__NAMESPACE__ . '\MigrateMenuConfigsTest',
__NAMESPACE__ . '\MigrateMenuLinkTest',
__NAMESPACE__ . '\MigrateMenuTest',
__NAMESPACE__ . '\MigrateNodeBundleSettingsTest',
__NAMESPACE__ . '\MigrateNodeConfigsTest',
__NAMESPACE__ . '\MigrateNodeRevisionTest',
__NAMESPACE__ . '\MigrateNodeTest',
......@@ -272,6 +283,7 @@ protected function getTestClassesList() {
__NAMESPACE__ . '\MigrateSystemFilterTest',
__NAMESPACE__ . '\MigrateSystemImageGdTest',
__NAMESPACE__ . '\MigrateSystemImageTest',
__NAMESPACE__ . '\MigrateSystemLoggingTest',
__NAMESPACE__ . '\MigrateSystemMaintenanceTest',
__NAMESPACE__ . '\MigrateSystemPerformanceTest',
__NAMESPACE__ . '\MigrateSystemRssTest',
......@@ -290,6 +302,7 @@ protected function getTestClassesList() {
__NAMESPACE__ . '\MigrateUploadTest',
__NAMESPACE__ . '\MigrateUrlAliasTest',
__NAMESPACE__ . '\MigrateUserConfigsTest',
__NAMESPACE__ . '\MigrateUserContactSettingsTest',
__NAMESPACE__ . '\MigrateUserProfileEntityDisplayTest',
__NAMESPACE__ . '\MigrateUserProfileEntityFormDisplayTest',
__NAMESPACE__ . '\MigrateUserProfileFieldTest',
......
......@@ -37,6 +37,16 @@ public function setUp() {
entity_create('node_type', array('type' => 'test_event'))->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.
$migration = entity_load('migration', 'd6_node_setting_promote');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment