Update to Drupal 8.1.8. For more information, see https://www.drupal.org/project/drupal/releases/8.1.8
This commit is contained in:
parent
e9f047ccf8
commit
f9f23cdf38
312 changed files with 6751 additions and 1546 deletions
|
@ -4,7 +4,10 @@ namespace Drupal\Tests\migrate_drupal\Kernel\d6;
|
|||
|
||||
use Drupal\field\Entity\FieldConfig;
|
||||
use Drupal\field\Entity\FieldStorageConfig;
|
||||
use Drupal\migrate\MigrateExecutable;
|
||||
use Drupal\migrate\MigrateMessageInterface;
|
||||
use Drupal\user\Entity\User;
|
||||
use Prophecy\Argument;
|
||||
|
||||
/**
|
||||
* @group migrate_drupal
|
||||
|
@ -85,4 +88,40 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
|
|||
$this->assertIdentical('proto@zo.an', $account->getInitialEmail());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that translation destination fails for untranslatable entities.
|
||||
*/
|
||||
public function testUntranslatable() {
|
||||
$this->enableModules(['language_test']);
|
||||
$this->installEntitySchema('no_language_entity_test');
|
||||
|
||||
/** @var MigrationInterface $migration */
|
||||
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration([
|
||||
'source' => [
|
||||
'plugin' => 'embedded_data',
|
||||
'ids' => ['id' => ['type' => 'integer']],
|
||||
'data_rows' => [['id' => 1]],
|
||||
],
|
||||
'process' => [
|
||||
'id' => 'id',
|
||||
],
|
||||
'destination' => [
|
||||
'plugin' => 'entity:no_language_entity_test',
|
||||
'translations' => TRUE,
|
||||
],
|
||||
]);
|
||||
|
||||
$message = $this->prophesize(MigrateMessageInterface::class);
|
||||
// Match the expected message. Can't use default argument types, because
|
||||
// we need to convert to string from TranslatableMarkup.
|
||||
$argument = Argument::that(function($msg) {
|
||||
return strpos((string) $msg, "This entity type does not support translation") !== FALSE;
|
||||
});
|
||||
$message->display($argument, Argument::any())
|
||||
->shouldBeCalled();
|
||||
|
||||
$executable = new MigrateExecutable($migration, $message->reveal());
|
||||
$executable->import();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,17 +89,24 @@ abstract class MigrateDrupal6TestBase extends MigrateDrupalTestBase {
|
|||
/**
|
||||
* Executes all content migrations.
|
||||
*
|
||||
* @param bool $include_revisions
|
||||
* If TRUE, migrates node revisions.
|
||||
* @param array $include
|
||||
* Extra things to include as part of the migrations. Values may be
|
||||
* 'revisions' or 'translations'.
|
||||
*/
|
||||
protected function migrateContent($include_revisions = FALSE) {
|
||||
protected function migrateContent($include = []) {
|
||||
if (in_array('translations', $include)) {
|
||||
$this->executeMigrations(['language']);
|
||||
}
|
||||
$this->migrateUsers(FALSE);
|
||||
$this->migrateFields();
|
||||
|
||||
$this->installEntitySchema('node');
|
||||
$this->executeMigrations(['d6_node_settings', 'd6_node']);
|
||||
|
||||
if ($include_revisions) {
|
||||
if (in_array('translations', $include)) {
|
||||
$this->executeMigrations(['translations']);
|
||||
}
|
||||
if (in_array('revisions', $include)) {
|
||||
$this->executeMigrations(['d6_node_revision']);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue