You are here

protected function MigrateNodeTaxonomyTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/Migrate/d7/MigrateNodeTaxonomyTest.php \Drupal\taxonomy\Tests\Migrate\d7\MigrateNodeTaxonomyTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides MigrateDrupal7TestBase::setUp

File

core/modules/taxonomy/src/Tests/Migrate/d7/MigrateNodeTaxonomyTest.php, line 37
Contains \Drupal\taxonomy\Tests\Migrate\d7\MigrateNodeTaxonomyTest.

Class

MigrateNodeTaxonomyTest
@group taxonomy

Namespace

Drupal\taxonomy\Tests\Migrate\d7

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('taxonomy_term');
  $this
    ->installConfig(static::$modules);
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $this
    ->executeMigration('d7_node_type');
  FieldStorageConfig::create(array(
    'type' => 'entity_reference',
    'field_name' => 'field_tags',
    'entity_type' => 'node',
    'settings' => array(
      'target_type' => 'taxonomy_term',
    ),
    'cardinality' => FieldStorageConfigInterface::CARDINALITY_UNLIMITED,
  ))
    ->save();
  FieldConfig::create(array(
    'entity_type' => 'node',
    'field_name' => 'field_tags',
    'bundle' => 'article',
  ))
    ->save();
  $this
    ->executeMigrations([
    'd7_taxonomy_vocabulary',
    'd7_taxonomy_term',
    'd7_user_role',
    'd7_user',
    'd7_node__article',
  ]);
}