Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
|
|
@ -20,14 +20,6 @@ use Drupal\simpletest\KernelTestBase;
|
|||
*/
|
||||
abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageInterface {
|
||||
|
||||
/**
|
||||
* The file path(s) to the dumped database(s) to load into the child site.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $databaseDumpFiles = array();
|
||||
|
||||
|
||||
/**
|
||||
* TRUE to collect messages instead of displaying them.
|
||||
*
|
||||
|
|
@ -52,6 +44,13 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
*/
|
||||
protected $migration;
|
||||
|
||||
/**
|
||||
* The source database connection.
|
||||
*
|
||||
* @var \Drupal\Core\Database\Connection
|
||||
*/
|
||||
protected $sourceDatabase;
|
||||
|
||||
public static $modules = array('migrate');
|
||||
|
||||
/**
|
||||
|
|
@ -60,6 +59,7 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->createMigrationConnection();
|
||||
$this->sourceDatabase = Database::getConnection('default', 'migrate');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -119,28 +119,6 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Drupal 6 database dumps to be used.
|
||||
*
|
||||
* @param array $files
|
||||
* An array of files.
|
||||
* @param string $method
|
||||
* The name of the method in the dump class to use. Defaults to load.
|
||||
*/
|
||||
protected function loadDumps(array $files, $method = 'load') {
|
||||
// Load the database from the portable PHP dump.
|
||||
// The files may be gzipped.
|
||||
foreach ($files as $file) {
|
||||
if (substr($file, -3) == '.gz') {
|
||||
$file = "compress.zlib://$file";
|
||||
require $file;
|
||||
}
|
||||
preg_match('/^namespace (.*);$/m', file_get_contents($file), $matches);
|
||||
$class = $matches[1] . '\\' . basename($file, '.php');
|
||||
(new $class(Database::getConnection('default', 'migrate')))->$method();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare any dependent migrations.
|
||||
*
|
||||
|
|
@ -153,9 +131,6 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
foreach ($id_mappings as $migration_id => $data) {
|
||||
// Use loadMultiple() here in order to load all variants.
|
||||
foreach (Migration::loadMultiple([$migration_id]) as $migration) {
|
||||
// Mark the dependent migrations as complete.
|
||||
$migration->setMigrationResult(MigrationInterface::RESULT_COMPLETED);
|
||||
|
||||
$id_map = $migration->getIdMap();
|
||||
$id_map->setMessage($this);
|
||||
$source_ids = $migration->getSourcePlugin()->getIds();
|
||||
|
|
@ -186,6 +161,17 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
(new MigrateExecutable($this->migration, $this))->import();
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a set of migrations in dependency order.
|
||||
*
|
||||
* @param string[] $ids
|
||||
* Array of migration IDs, in any order.
|
||||
*/
|
||||
protected function executeMigrations(array $ids) {
|
||||
$migrations = Migration::loadMultiple($ids);
|
||||
array_walk($migrations, [$this, 'executeMigration']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
Reference in a new issue