You are here

public function MediaMigrationTestBase::setUp in Media Migration 8

Overrides MigrateDrupalTestBase::setUp

File

tests/src/Kernel/Migrate/MediaMigrationTestBase.php, line 34

Class

MediaMigrationTestBase
Base class for Media Migration kernel tests.

Namespace

Drupal\Tests\media_migration\Kernel\Migrate

Code

public function setUp() {
  parent::setUp();
  $this
    ->loadFixture($this
    ->getFixtureFilePath());
  $module_handler = \Drupal::moduleHandler();
  $this
    ->installEntitySchema('file');
  $this
    ->installSchema('file', 'file_usage');
  if ($module_handler
    ->moduleExists('node')) {
    $this
      ->installEntitySchema('node');
    $this
      ->installSchema('node', 'node_access');
  }
  if ($module_handler
    ->moduleExists('embed')) {
    $this
      ->installEntitySchema('embed_button');
  }
  if ($module_handler
    ->moduleExists('media')) {
    $this
      ->installEntitySchema('media');
  }
  if ($module_handler
    ->moduleExists('comment')) {
    $this
      ->installEntitySchema('comment');
    $this
      ->installSchema('comment', 'comment_entity_statistics');
  }
  $this
    ->installSchema('media_migration', MediaMigration::MEDIA_UUID_PROPHECY_TABLE);
}