function MigrateForumTest::testForumMigration
Same name in other branches
- 9 core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateForumTest::testForumMigration()
- 8.9.x core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateForumTest::testForumMigration()
- 11.x core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateForumTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateForumTest::testForumMigration()
Tests forum migration.
File
-
core/
modules/ forum/ tests/ src/ Kernel/ Migrate/ d6/ MigrateForumTest.php, line 65
Class
- MigrateForumTest
- Tests forum migration from Drupal 6 to Drupal 8.
Namespace
Drupal\Tests\forum\Kernel\Migrate\d6Code
public function testForumMigration() : void {
// 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->assertIsArray($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->assertIsArray($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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.