You are here

protected function MigrateNodeTestBase::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/Migrate/d6/MigrateNodeTestBase.php \Drupal\node\Tests\Migrate\d6\MigrateNodeTestBase::setUp()

Performs setup tasks before each individual test method is run.

Overrides MigrateDrupal6TestBase::setUp

2 calls to MigrateNodeTestBase::setUp()
MigrateNodeRevisionTest::setUp in core/modules/node/src/Tests/Migrate/d6/MigrateNodeRevisionTest.php
Performs setup tasks before each individual test method is run.
MigrateNodeTest::setUp in core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php
Performs setup tasks before each individual test method is run.
2 methods override MigrateNodeTestBase::setUp()
MigrateNodeRevisionTest::setUp in core/modules/node/src/Tests/Migrate/d6/MigrateNodeRevisionTest.php
Performs setup tasks before each individual test method is run.
MigrateNodeTest::setUp in core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php
Performs setup tasks before each individual test method is run.

File

core/modules/node/src/Tests/Migrate/d6/MigrateNodeTestBase.php, line 21
Contains \Drupal\node\Tests\Migrate\d6\MigrateNodeTestBase.

Class

MigrateNodeTestBase
Base class for Node migration tests.

Namespace

Drupal\node\Tests\Migrate\d6

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('node');
  $this
    ->installConfig([
    'node',
  ]);
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installSchema('system', [
    'sequences',
  ]);

  // Create a new user which needs to have UID 1, because that is expected by
  // the assertions from
  // \Drupal\migrate_drupal\Tests\d6\MigrateNodeRevisionTest.
  User::create([
    'uid' => 1,
    'name' => $this
      ->randomMachineName(),
    'status' => 1,
  ])
    ->enforceIsNew()
    ->save();
  $this
    ->migrateUsers(FALSE);
  $this
    ->migrateFields();
  $this
    ->executeMigration('d6_node_settings');
}