class MigrateNodeTaxonomyTest

Same name and namespace in other branches
  1. 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateNodeTaxonomyTest
  2. 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateNodeTaxonomyTest
  3. 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d7\MigrateNodeTaxonomyTest

@group taxonomy

Hierarchy

Expanded class hierarchy of MigrateNodeTaxonomyTest

File

core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php, line 12

Namespace

Drupal\Tests\taxonomy\Kernel\Migrate\d7
View source
class MigrateNodeTaxonomyTest extends MigrateDrupal7TestBase {
  protected static $modules = [
    'comment',
    'datetime',
    'datetime_range',
    'image',
    'link',
    'menu_ui',
    'node',
    'taxonomy',
    'telephone',
    'text',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('file');
    $this->migrateTaxonomyTerms();
    $this->migrateUsers(FALSE);
    $this->executeMigration('d7_node:article');
  }
  
  /**
   * Tests node migration from Drupal 7 to 8.
   */
  public function testMigration() {
    $node = Node::load(2);
    $this->assertInstanceOf(NodeInterface::class, $node);
    $this->assertEquals(9, $node->field_tags[0]->target_id);
    $this->assertEquals(14, $node->field_tags[1]->target_id);
    $this->assertEquals(17, $node->field_tags[2]->target_id);
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.