You are here

protected function DrushTestBase::loadFixture in Media Migration 8

Loads a database fixture into the source database connection.

This method is the exact copy of Drupal\Tests\migrate\Kernel\MigrateTestBase::loadFixture().

Parameters

string $path: Path to the dump file.

1 call to DrushTestBase::loadFixture()
DrushTestBase::setUp in tests/src/Functional/DrushTestBase.php

File

tests/src/Functional/DrushTestBase.php, line 105

Class

DrushTestBase
Base class for testing media migrations executed with Drush.

Namespace

Drupal\Tests\media_migration\Functional

Code

protected function loadFixture($path) {
  $default_db = Database::getConnection()
    ->getKey();
  Database::setActiveConnection($this->sourceDatabase
    ->getKey());
  if (substr($path, -3) == '.gz') {
    $path = 'compress.zlib://' . $path;
  }
  require $path;
  Database::setActiveConnection($default_db);
}