Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
|
|
@ -8,7 +8,9 @@
|
|||
namespace Drupal\migrate\Tests;
|
||||
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\migrate\Entity\Migration;
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate\MigrateExecutable;
|
||||
use Drupal\migrate\MigrateMessageInterface;
|
||||
use Drupal\migrate\Row;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
|
@ -43,6 +45,13 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
*/
|
||||
protected $migrateMessages;
|
||||
|
||||
/**
|
||||
* The primary migration being tested.
|
||||
*
|
||||
* @var \Drupal\migrate\Entity\MigrationInterface
|
||||
*/
|
||||
protected $migration;
|
||||
|
||||
public static $modules = array('migrate');
|
||||
|
||||
/**
|
||||
|
|
@ -73,21 +82,6 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the migration.
|
||||
*
|
||||
* @param \Drupal\migrate\Entity\MigrationInterface $migration
|
||||
* The migration object.
|
||||
* @param array $files
|
||||
* An array of files.
|
||||
*/
|
||||
protected function prepare(MigrationInterface $migration, array $files = array()) {
|
||||
$this->loadDumps($files);
|
||||
if ($this instanceof MigrateDumpAlterInterface) {
|
||||
static::migrateDumpAlter($this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Drupal 6 database dumps to be used.
|
||||
*
|
||||
|
|
@ -96,7 +90,7 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
* @param string $method
|
||||
* The name of the method in the dump class to use. Defaults to load.
|
||||
*/
|
||||
protected function loadDumps($files, $method = '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) {
|
||||
|
|
@ -137,6 +131,25 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a single migration.
|
||||
*
|
||||
* @param string|\Drupal\migrate\Entity\MigrationInterface $migration
|
||||
* The migration to execute, or its ID.
|
||||
*/
|
||||
protected function executeMigration($migration) {
|
||||
if (is_string($migration)) {
|
||||
$this->migration = Migration::load($migration);
|
||||
}
|
||||
else {
|
||||
$this->migration = $migration;
|
||||
}
|
||||
if ($this instanceof MigrateDumpAlterInterface) {
|
||||
static::migrateDumpAlter($this);
|
||||
}
|
||||
(new MigrateExecutable($this->migration, $this))->import();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
Reference in a new issue