You are here

protected function MigrateDrupalTestBase::loadFixture in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php \Drupal\migrate_drupal\Tests\MigrateDrupalTestBase::loadFixture()

Loads a database fixture into the source database connection.

Parameters

string $path: Path to the dump file.

2 calls to MigrateDrupalTestBase::loadFixture()
MigrateDrupal6TestBase::setUp in core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php
Performs setup tasks before each individual test method is run.
MigrateDrupal7TestBase::setUp in core/modules/migrate_drupal/src/Tests/d7/MigrateDrupal7TestBase.php
Performs setup tasks before each individual test method is run.

File

core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php, line 41
Contains \Drupal\migrate_drupal\Tests\MigrateDrupalTestBase.

Class

MigrateDrupalTestBase
Base class for Drupal migration tests.

Namespace

Drupal\migrate_drupal\Tests

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);
}