executeMigrations example

'text',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installConfig(['node']);
    $this->executeMigration('language');
    $this->migrateFields();
    $this->executeMigrations([
      'd7_field_option_translation',
      'd7_field_instance_option_translation',
    ]);
  }

  /** * Migrate field instance option translations. */
  public function testFieldInstanceOptionTranslation() {
    $language_manager = $this->container->get('language_manager');

    
/** * {@inheritdoc} */
  protected static $modules = ['language'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->executeMigrations([
      'language',
      'user_profile_field',
      'user_profile_field_instance',
      'user_profile_entity_display',
      'user_profile_entity_form_display',
    ]);
    $this->migrateUsers(FALSE);
    $this->executeMigration('d6_profile_values');
  }

  /** * Tests Drupal 6 profile values to Drupal 8 migration. */
protected function getFixtureFilePath() {
    return __DIR__ . '/../../../fixtures/drupal6.php';
  }

  /** * Executes all user migrations. * * @param bool $include_pictures * If TRUE, migrates user pictures. */
  protected function migrateUsers($include_pictures = TRUE) {
    $this->executeMigrations(['d6_filter_format', 'd6_user_role']);

    if ($include_pictures) {
      $this->installEntitySchema('file');
      $this->executeMigrations([
        'd6_file',
        'd6_user_picture_file',
        'user_picture_field',
        'user_picture_field_instance',
        'user_picture_entity_display',
        'user_picture_entity_form_display',
      ]);
    }

class MigrateUserPictureFieldInstanceTest extends MigrateDrupal7TestBase {

  protected static $modules = ['image', 'file'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->executeMigrations([
      'user_picture_field',
      'user_picture_field_instance',
    ]);
  }

  /** * Tests the user picture field migration. */
  public function testUserPictureField() {
    /** @var \Drupal\field\FieldConfigInterface $field */
    $field = FieldConfig::load('user.user.user_picture');
    
/** * {@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 */
$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',
      'd7_taxonomy_term_entity_translation',
      
'config_translation',
    'language',
    'locale',
    'menu_ui',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->executeMigrations([
      'language',
      'user_profile_field',
      'user_profile_field_instance',
      'd6_profile_field_option_translation',
    ]);
  }

  /** * Tests the Drupal 6 field option translation. */
  public function testFieldOptionTranslation() {
    

  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);
  }

}

  protected function setUp(): void {
    parent::setUp();

    $this->setUpCurrentUser();

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

    $this->migrateUsers(FALSE);
    $this->migrateContentTypes();
    $this->executeMigrations([
      'language',
      'd7_language_types',
      'd7_language_negotiation_settings',
      'd7_node',
      'd7_node_translation',
    ]);
  }

  /** * Tests that not found node translations are redirected. */
  
'd6_system_cron',
      'd6_system_date',
      'd6_system_file',
      'system_image_gd',
      'system_image',
      'system_logging',
      'system_maintenance',
      'd6_system_performance',
      'system_rss',
      'system_site',
    ];
    $this->executeMigrations($migrations);
  }

  /** * Tests that all expected configuration gets migrated. */
  public function testConfigurationMigration() {
    foreach ($this->expectedConfig as $config_id => $values) {
      $actual = \Drupal::config($config_id)->get();
      unset($actual['_core']);
      $this->assertSame($values$actual$config_id . ' matches expected values.');
    }
  }
'taxonomy',
    'telephone',
    'text',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateFields();
    $this->executeMigrations([
      'd7_view_modes',
      'd7_field_formatter_settings',
    ]);
  }

  /** * Asserts various aspects of a view display. * * @param string $id * The view display ID. * * @internal */
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')
      ->resetCache([1, 2]);

    $nodes = Node::loadMultiple([1, 2]);
    $node = $nodes[1];
    $this->assertCount(1, $node->field_vocabulary_1_i_0_);
    $this->assertSame('1', $node->field_vocabulary_1_i_0_[0]->target_id);
    $node = $nodes[2];
    $this->assertCount(2, $node->field_vocabulary_2_i_1_);
    

  protected static $modules = ['block', 'block_content'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installEntitySchema('block_content');
    $this->installConfig(['block_content']);

    $this->executeMigrations([
      'd6_filter_format',
      'block_content_type',
      'block_content_body_field',
      'd6_custom_block',
    ]);
  }

  /** * Tests the Drupal 6 content block to Drupal 8 migration. */
  public function testBlockMigration() {
    


  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installEntitySchema('block_content');
    $this->installConfig(['block']);
    $this->installConfig(['block_content']);

    $this->executeMigrations([
      'language',
      'd6_filter_format',
      'block_content_type',
      'block_content_body_field',
      'd6_custom_block',
      'd6_user_role',
      'd6_block',
      'd6_block_translation',
    ]);
    block_rebuild();
  }

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

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    // Execute Dependency Migrations.     $this->migrateContentTypes();
    $this->installEntitySchema('taxonomy_term');
    $this->executeMigrations([
      'd6_node_type',
      'd6_taxonomy_vocabulary',
      'd6_vocabulary_field',
    ]);
  }

  /** * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */
  public function testVocabularyFieldInstance() {
    $this->executeMigration('d6_vocabulary_field_instance');

    
Home | Imprint | This part of the site doesn't use cookies.