diff --git a/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php index 454f58c..6f5d48c 100644 --- a/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php +++ b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php @@ -2,6 +2,10 @@ namespace Drupal\Tests\forum\Kernel\Migrate\d6; +use Drupal\Core\Entity\Entity\EntityFormDisplay; +use Drupal\Core\Entity\Entity\EntityViewDisplay; +use Drupal\field\Entity\FieldConfig; +use Drupal\field\Entity\FieldStorageConfig; use Drupal\node\Entity\Node; use Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase; @@ -49,6 +53,23 @@ protected function setUp() { * Tests forum migration. */ public function testForumMigration() { + // Tests that the taxonomy_forums field storage config exists. + $field_storage_config = FieldStorageConfig::load('node.taxonomy_forums'); + $this->assertInstanceOf(FieldStorageConfig::class, $field_storage_config); + + // Tests that the taxonomy_forums field config exists. + $field_config = FieldConfig::load('node.forum.taxonomy_forums'); + $this->assertInstanceOf(FieldConfig::class, $field_config); + + // Tests that the taxonomy_forums entity view display component exists. + $entity_view_display = EntityViewDisplay::load('node.forum.default')->getComponent('taxonomy_forums'); + $this->assertTrue(is_array($entity_view_display)); + + // Tests that the taxonomy_forums entity form display component exists. + $entity_form_display = EntityFormDisplay::load('node.forum.default')->getComponent('taxonomy_forums'); + $this->assertTrue(is_array($entity_form_display)); + + // Test that the taxonomy_forums field has the right value. $node = Node::load(19); $this->assertEquals(8, $node->taxonomy_forums->target_id); } diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php index 1feef82..150a7fd 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -9624,6 +9624,14 @@ 'objectindex' => '0', 'format' => '0', )) +->values(array( + 'lid' => '1672', + 'objectid' => '6', + 'type' => 'vocabulary', + 'property' => 'name', + 'objectindex' => '6', + 'format' => '0', +)) ->execute(); $connection->schema()->createTable('i18n_variable', array( @@ -22076,6 +22084,13 @@ 'source' => '%name: Title mismatch. Please check your selection.', 'version' => 'none', )) +->values(array( + 'lid' => '1672', + 'location' => 'vocabulary:6:name', + 'textgroup' => 'taxonomy', + 'source' => 'Forums', + 'version' => '1', +)) ->execute(); $connection->schema()->createTable('locales_target', array( @@ -43852,7 +43867,7 @@ 'uid' => '1', 'title' => 'New Forum Topic', 'body' => 'New Forum Body', - 'teaser' => 'New Forum Teaser', + 'teaser' => '', 'log' => '', 'timestamp' => '1494367644', 'format' => '1', @@ -46190,6 +46205,10 @@ 'parent' => '0', )) ->values(array( + 'tid' => '8', + 'parent' => '0', +)) +->values(array( 'tid' => '3', 'parent' => '2', ))