function EntityContentBaseTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\EntityContentBaseTest::setUp()
  2. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\EntityContentBaseTest::setUp()
  3. 11.x core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\EntityContentBaseTest::setUp()

Overrides MigrateDrupal6TestBase::setUp

File

core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php, line 27

Class

EntityContentBaseTest
@group migrate_drupal

Namespace

Drupal\Tests\migrate_drupal\Kernel\d6

Code

protected function setUp() : void {
  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' => [
      [
        'value' => 'Bring a towel.',
        'format' => 'filtered_html',
      ],
    ],
    'init' => 'proto@zo.an',
  ])->save();
  $this->executeMigrations([
    'd6_filter_format',
    'd6_user_role',
  ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.