X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FKernel%2FMigrateDrupalTestBase.php;fp=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FKernel%2FMigrateDrupalTestBase.php;h=063c99cb36473f234336648ed0f4515a5d20f400;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php b/web/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php new file mode 100644 index 000000000..063c99cb3 --- /dev/null +++ b/web/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php @@ -0,0 +1,47 @@ +installEntitySchema('user'); + $this->installConfig(['migrate_drupal', 'system']); + } + + /** + * Loads a database fixture into the source database connection. + * + * @param string $path + * Path to the dump file. + */ + 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); + } + +}