migrateTaxonomy example

// Remove the classic node table made in setup.     $this->removeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '6');

    $this->installSchema('node', ['node_access']);
    $this->installEntitySchema('node');

    $this->executeMigration('language');
    $this->migrateUsers(FALSE);
    $this->migrateFields();
    $this->executeMigrations(['d6_node_settings', 'd6_node_complete']);
    $this->migrateTaxonomy();
    // This is a base plugin ID and we want to run all derivatives.     $this->executeMigrations(['d6_term_node']);
  }

  /** * Tests the Drupal 6 term-node association to Drupal 8 migration. */
  public function testTermNode() {
    $this->container->get('entity_type.manager')
      ->getStorage('node')
      ->resetCache([1, 2]);

    

  protected static $modules = ['taxonomy', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installSchema('node', ['node_access']);
    $this->migrateContent();
    $this->migrateTaxonomy();
  }

  /** * Tests the Drupal 6 term-node association to Drupal 8 migration. */
  public function testTermNode() {
    // This is a base plugin id and we want to run all derivatives.     $this->executeMigrations(['d6_term_node']);

    $this->container->get('entity_type.manager')
      ->getStorage('node')
      
/** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->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',
    ]);
  }

  

  protected static $modules = ['taxonomy', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installSchema('node', ['node_access']);
    $this->migrateContent(['revisions']);
    $this->migrateTaxonomy();
    $this->executeMigrations(['d6_term_node', 'd6_term_node_revision']);
  }

  /** * Tests the Drupal 6 term-node revision association to Drupal 8 migration. */
  public function testTermRevisionNode() {
    $node = \Drupal::entityTypeManager()->getStorage('node')->loadRevision(2001);
    $this->assertCount(2, $node->field_vocabulary_3_i_2_);
    $this->assertSame('4', $node->field_vocabulary_3_i_2_[0]->target_id);
    $this->assertSame('5', $node->field_vocabulary_3_i_2_[1]->target_id);
  }
/** * {@inheritdoc} */
  protected static $modules = ['taxonomy', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateTaxonomy();
  }

  /** * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */
  public function testVocabularyField() {
    // Test that the field exists.     $field_storage_id = 'node.field_tags';
    /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
    $field_storage = FieldStorageConfig::load($field_storage_id);
    $this->assertSame($field_storage_id$field_storage->id());

    
parent::setUp();

    $this->installEntitySchema('node');
    $this->installConfig(['node']);
    $this->installSchema('node', ['node_access']);
    $this->installSchema('system', ['sequences']);

    $this->executeMigration('language');
    $this->executeMigration('d6_node_settings');
    $this->migrateUsers(FALSE);
    $this->migrateFields();
    $this->migrateTaxonomy();
    $this->migrateContent(['translations']);

    // This is a base plugin id and we want to run all derivatives.     $this->executeMigrations([
      'd6_term_node',
      'd6_term_node_translation',
    ]);
  }

  /** * Tests the Drupal 6 term-node association to Drupal 8 migration. */
Home | Imprint | This part of the site doesn't use cookies.