3 namespace Drupal\Tests\migrate_drupal\Kernel;
5 use Drupal\Core\Database\Database;
6 use Drupal\Tests\migrate\Kernel\MigrateTestBase;
9 * Base class for Drupal migration tests.
11 abstract class MigrateDrupalTestBase extends MigrateTestBase {
18 public static $modules = ['system', 'user', 'field', 'migrate_drupal', 'options', 'file'];
23 protected function setUp() {
25 $this->installEntitySchema('user');
26 $this->installConfig(['migrate_drupal', 'system']);
30 * Loads a database fixture into the source database connection.
33 * Path to the dump file.
35 protected function loadFixture($path) {
36 $default_db = Database::getConnection()->getKey();
37 Database::setActiveConnection($this->sourceDatabase->getKey());
39 if (substr($path, -3) == '.gz') {
40 $path = 'compress.zlib://' . $path;
44 Database::setActiveConnection($default_db);