You are here

public function EntityContentBaseTest::setUp in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/migrate_drupal/src/Tests/d6/EntityContentBaseTest.php \Drupal\migrate_drupal\Tests\d6\EntityContentBaseTest::setUp()
  2. 8 core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityContentBaseTest::setUp()
Same name and namespace in other branches
  1. 8.0 core/modules/migrate_drupal/src/Tests/d6/EntityContentBaseTest.php \Drupal\migrate_drupal\Tests\d6\EntityContentBaseTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides MigrateDrupal6TestBase::setUp

File

core/modules/migrate_drupal/src/Tests/d6/EntityContentBaseTest.php, line 27
Contains \Drupal\migrate_drupal\Tests\d6\EntityContentBaseTest.

Class

EntityContentBaseTest
@group migrate_drupal

Namespace

Drupal\migrate_drupal\Tests\d6

Code

public function setUp() {
  parent::setUp();

  // Create a field on the user entity so that we can test nested property
  // overwrites.
  // @see static::testOverwriteSelectedNestedProperty()
  FieldStorageConfig::create([
    'field_name' => 'signature',
    'entity_type' => 'user',
    'type' => 'text_long',
  ])
    ->save();
  FieldConfig::create([
    'field_name' => 'signature',
    'entity_type' => 'user',
    'bundle' => 'user',
  ])
    ->save();
  User::create([
    'uid' => 2,
    'name' => 'Ford Prefect',
    'mail' => 'ford.prefect@localhost',
    'signature' => array(
      array(
        'value' => 'Bring a towel.',
        'format' => 'filtered_html',
      ),
    ),
    'init' => 'proto@zo.an',
  ])
    ->save();
  $this
    ->executeMigrations([
    'd6_filter_format',
    'd6_user_role',
  ]);
}