migrateTaxonomyTerms example

'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);
    
parent::setUp();

    $this->fileMigrationSetup();

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

    $this->migrateUsers();
    $this->migrateFields();
    $this->migrateTaxonomyTerms();
    $this->executeMigrations([
      'language',
      'd7_language_content_taxonomy_vocabulary_settings',
      'd7_taxonomy_term_localized_translation',
      'd7_taxonomy_term_translation',
      'd7_language_content_settings',
      'd7_comment_field',
      'd7_comment_field_instance',
      'd7_node',
      'd7_node_translation',
      'd7_entity_translation_settings',
      
protected $treeData = [];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installConfig('forum');
    $this->installEntitySchema('comment');
    $this->installEntitySchema('file');

    $this->migrateTaxonomyTerms();
    $this->executeMigrations([
      'language',
      'd7_user_role',
      'd7_user',
      'd7_entity_translation_settings',
      'd7_taxonomy_term_entity_translation',
    ]);
  }

  /** * Validate a migrated term contains the expected values. * * @param int $id * Entity ID to load and check. * @param string $expected_language * The language code for this term. * @param $expected_label * The label the migrated entity should have. * @param $expected_vid * The parent vocabulary the migrated entity should have. * @param string|null $expected_description * The description the migrated entity should have. * @param string|null $expected_format * The format the migrated entity should have. * @param int $expected_weight * The weight the migrated entity should have. * @param array $expected_parents * The parent terms the migrated entity should have. * @param int $expected_field_integer_value * The value the migrated entity field should have. * @param int $expected_term_reference_tid * The term reference id the migrated entity field should have. * @param int|null $expected_container_flag * The term should be a container entity. * * @internal */
Home | Imprint | This part of the site doesn't use cookies.