diff --git a/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumConfigsTest.php b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumConfigsTest.php index 7aa848e..302c3d1 100644 --- a/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumConfigsTest.php +++ b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumConfigsTest.php @@ -36,7 +36,7 @@ public function testForumSettings() { $this->assertIdentical(15, $config->get('topics.hot_threshold')); $this->assertIdentical(25, $config->get('topics.page_limit')); $this->assertIdentical(1, $config->get('topics.order')); - $this->assertIdentical('vocabulary_1_i_0_', $config->get('vocabulary')); + $this->assertIdentical('forums', $config->get('vocabulary')); // This is 'forum_block_num_0' in D6, but block:active:limit' in D8. $this->assertSame(3, $config->get('block.active.limit')); // This is 'forum_block_num_1' in D6, but 'block:new:limit' in D8. diff --git a/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php new file mode 100644 index 0000000..0d3c447 --- /dev/null +++ b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php @@ -0,0 +1,56 @@ +installEntitySchema('comment'); + $this->installSchema('comment', ['comment_entity_statistics']); + $this->installSchema('forum', ['forum', 'forum_index']); + $this->installConfig(['comment', 'forum']); + $this->migrateContent(); + $this->migrateTaxonomy(); + $this->executeMigrations([ + 'd6_comment_type', + 'd6_comment_field', + 'd6_comment_field_instance', + 'd6_comment_entity_display', + 'd6_comment_entity_form_display', + 'd6_comment', + 'd6_term_node', + ]); + } + + /** + * Tests forum migration. + */ + public function testForumMigration() { + $node = Node::load(19); + $this->assertEquals([0 => ['target_id' => '7']], $node->get('taxonomy_forums')->getValue()); + } + +} diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php index 4b8b3dc..90364bd 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -1927,6 +1927,54 @@ 'mail' => 'comment3@example.com', 'homepage' => 'https://www.drupal.org', )) +->values(array( + 'cid' => '4', + 'pid' => '0', + 'nid' => '19', + 'uid' => '1', + 'subject' => 'Subject 1', + 'comment' => 'Comment 1', + 'hostname' => '127.0.0.1', + 'timestamp' => '1494367652', + 'status' => '0', + 'format' => '1', + 'thread' => '01/', + 'name' => 'root', + 'mail' => '', + 'homepage' => '', +)) +->values(array( + 'cid' => '5', + 'pid' => '4', + 'nid' => '19', + 'uid' => '1', + 'subject' => 'Subject 2', + 'comment' => 'Comment 2', + 'hostname' => '127.0.0.1', + 'timestamp' => '1494367659', + 'status' => '0', + 'format' => '1', + 'thread' => '01.00/', + 'name' => 'root', + 'mail' => '', + 'homepage' => '', +)) +->values(array( + 'cid' => '6', + 'pid' => '5', + 'nid' => '19', + 'uid' => '1', + 'subject' => 'Subject 3', + 'comment' => 'Comment 3', + 'hostname' => '127.0.0.1', + 'timestamp' => '1494367666', + 'status' => '0', + 'format' => '1', + 'thread' => '01.00.00/', + 'name' => 'root', + 'mail' => '', + 'homepage' => '', +)) ->execute(); $connection->schema()->createTable('config', array( @@ -8295,6 +8343,19 @@ 'mysql_character_set' => 'utf8', )); +$connection->insert('forum') +->fields(array( + 'nid', + 'vid', + 'tid', +)) +->values(array( + 'nid' => '19', + 'vid' => '22', + 'tid' => '7', +)) +->execute(); + $connection->schema()->createTable('history', array( 'fields' => array( 'uid' => array( @@ -8374,6 +8435,11 @@ 'nid' => '18', 'timestamp' => '1493066711', )) +->values(array( + 'uid' => '1', + 'nid' => '19', + 'timestamp' => '1494367685', +)) ->execute(); $connection->schema()->createTable('i18n_blocks', array( @@ -43000,6 +43066,23 @@ 'tnid' => '0', 'translate' => '0', )) +->values(array( + 'nid' => '19', + 'vid' => '22', + 'type' => 'forum', + 'language' => '', + 'title' => 'New Forum Topic', + 'uid' => '1', + 'status' => '1', + 'created' => '1494367644', + 'changed' => '1494367644', + 'comment' => '2', + 'promote' => '0', + 'moderate' => '0', + 'sticky' => '0', + 'tnid' => '0', + 'translate' => '0', +)) ->execute(); $connection->schema()->createTable('node_access', array( @@ -43199,6 +43282,13 @@ 'last_comment_uid' => '1', 'comment_count' => '0', )) +->values(array( + 'nid' => '19', + 'last_comment_timestamp' => '1494367666', + 'last_comment_name' => '', + 'last_comment_uid' => '1', + 'comment_count' => '3', +)) ->execute(); $connection->schema()->createTable('node_counter', array( @@ -43274,6 +43364,12 @@ 'daycount' => '1', 'timestamp' => '1493066711', )) +->values(array( + 'nid' => '19', + 'totalcount' => '5', + 'daycount' => '5', + 'timestamp' => '1494367685', +)) ->execute(); $connection->schema()->createTable('node_revisions', array( @@ -43580,6 +43676,17 @@ 'timestamp' => '1493066711', 'format' => '1', )) +->values(array( + 'nid' => '19', + 'vid' => '22', + 'uid' => '1', + 'title' => 'New Forum Topic', + 'body' => 'New Forum Body', + 'teaser' => 'New Forum Teaser', + 'log' => '', + 'timestamp' => '1494367644', + 'format' => '1', +)) ->execute(); $connection->schema()->createTable('node_type', array( @@ -45847,6 +45954,15 @@ 'language' => '', 'trid' => '0', )) +->values(array( + 'tid' => '7', + 'vid' => '6', + 'name' => 'General discussion', + 'description' => '', + 'weight' => '0', + 'language' => '', + 'trid' => '0', +)) ->execute(); $connection->schema()->createTable('term_hierarchy', array( @@ -45891,6 +46007,10 @@ 'parent' => '0', )) ->values(array( + 'tid' => '7', + 'parent' => '0', +)) +->values(array( 'tid' => '3', 'parent' => '2', )) @@ -45970,6 +46090,11 @@ 'vid' => '2', 'tid' => '5', )) +->values(array( + 'nid' => '19', + 'vid' => '22', + 'tid' => '7', +)) ->execute(); $connection->schema()->createTable('term_relation', array( @@ -47448,7 +47573,7 @@ )) ->values(array( 'name' => 'forum_nav_vocabulary', - 'value' => 's:1:"1";', + 'value' => 's:1:"6";', )) ->values(array( 'name' => 'forum_order', @@ -48034,6 +48159,20 @@ 'weight' => '7', 'language' => '', )) +->values(array( + 'vid' => '6', + 'name' => 'Forums', + 'description' => '', + 'help' => '', + 'relations' => '1', + 'hierarchy' => '0', + 'multiple' => '0', + 'required' => '0', + 'tags' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'language' => '', +)) ->execute(); $connection->schema()->createTable('vocabulary_node_types', array( @@ -48069,7 +48208,7 @@ 'type' => 'article', )) ->values(array( - 'vid' => '1', + 'vid' => '6', 'type' => 'forum', )) ->values(array( diff --git a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php index 077df12..bd5eae1 100644 --- a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php +++ b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php @@ -39,19 +39,19 @@ protected function getEntityCounts() { 'block' => 35, 'block_content' => 2, 'block_content_type' => 1, - 'comment' => 3, + 'comment' => 6, 'comment_type' => 3, 'contact_form' => 5, 'configurable_language' => 5, 'editor' => 2, 'field_config' => 72, - 'field_storage_config' => 47, + 'field_storage_config' => 48, 'file' => 7, 'filter_format' => 7, 'image_style' => 5, 'language_content_settings' => 2, 'migration' => 105, - 'node' => 16, + 'node' => 17, 'node_type' => 13, 'rdf_mapping' => 7, 'search_page' => 2, @@ -59,7 +59,7 @@ protected function getEntityCounts() { 'shortcut_set' => 1, 'action' => 22, 'menu' => 8, - 'taxonomy_term' => 6, + 'taxonomy_term' => 7, 'taxonomy_vocabulary' => 6, 'tour' => 4, 'user' => 7,