Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
web/core/modules/migrate_drupal
|
@ -20,7 +20,7 @@ function migrate_drupal_help($route_name, RouteMatchInterface $route_match) {
|
|||
case 'help.page.migrate_drupal':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('The Migrate Drupal module provides a framework based on the <a href=":migrate">Migrate module</a> to facilitate migration from a Drupal (6, 7, or 8) site to your website. It does not provide a user interface. For more information, see the <a href=":migrate_drupal">online documentation for the Migrate Drupal module</a>.', array(':migrate' => \Drupal::url('help.page', array('name' => 'migrate')), ':migrate_drupal' => 'https://www.drupal.org/documentation/modules/migrate_drupal')) . '</p>';
|
||||
$output .= '<p>' . t('The Migrate Drupal module provides a framework based on the <a href=":migrate">Migrate module</a> to facilitate migration from a Drupal (6, 7, or 8) site to your website. It does not provide a user interface. For more information, see the <a href=":migrate_drupal">online documentation for the Migrate Drupal module</a>.', [':migrate' => \Drupal::url('help.page', ['name' => 'migrate']), ':migrate_drupal' => 'https://www.drupal.org/documentation/modules/migrate_drupal']) . '</p>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
namespace Drupal\migrate_drupal\Plugin\migrate\destination;
|
||||
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Entity\EntityStorageInterface;
|
||||
use Drupal\Core\Field\FieldTypePluginManagerInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig as BaseEntityFieldStorageConfig;
|
||||
|
@ -45,11 +47,17 @@ class EntityFieldStorageConfig extends BaseEntityFieldStorageConfig {
|
|||
* The storage for this entity type.
|
||||
* @param array $bundles
|
||||
* The list of bundles this entity type has.
|
||||
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
|
||||
* The language manager.
|
||||
* @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_plugin_manager
|
||||
* The field type plugin manager.
|
||||
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||
* The configuration factory.
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, FieldTypePluginManagerInterface $field_type_plugin_manager) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles);
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, FieldTypePluginManagerInterface $field_type_plugin_manager) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $language_manager, $config_factory, $field_type_plugin_manager);
|
||||
$this->languageManager = $language_manager;
|
||||
$this->configFactory = $config_factory;
|
||||
$this->fieldTypePluginManager = $field_type_plugin_manager;
|
||||
}
|
||||
|
||||
|
@ -65,6 +73,8 @@ class EntityFieldStorageConfig extends BaseEntityFieldStorageConfig {
|
|||
$migration,
|
||||
$container->get('entity.manager')->getStorage($entity_type_id),
|
||||
array_keys($container->get('entity.manager')->getBundleInfo($entity_type_id)),
|
||||
$container->get('language_manager'),
|
||||
$container->get('config.factory'),
|
||||
$container->get('plugin.manager.field.field_type')
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ use Drupal\Core\State\StateInterface;
|
|||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Drupal\migrate\Exception\RequirementsException;
|
||||
use Drupal\migrate\Plugin\migrate\source\SqlBase;
|
||||
use Drupal\migrate\Plugin\RequirementsInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
|
@ -19,7 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
* Mainly to let children retrieve information from the origin system in an
|
||||
* easier way.
|
||||
*/
|
||||
abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginInterface, RequirementsInterface, DependentPluginInterface {
|
||||
abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginInterface, DependentPluginInterface {
|
||||
|
||||
use DependencyTrait;
|
||||
|
||||
|
@ -60,7 +59,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
|
|||
*/
|
||||
public function getSystemData() {
|
||||
if (!isset($this->systemData)) {
|
||||
$this->systemData = array();
|
||||
$this->systemData = [];
|
||||
try {
|
||||
$results = $this->select('system', 's')
|
||||
->fields('s')
|
||||
|
@ -106,6 +105,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
|
|||
}
|
||||
}
|
||||
}
|
||||
parent::checkRequirements();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,7 +149,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
|
|||
protected function variableGet($name, $default) {
|
||||
try {
|
||||
$result = $this->select('variable', 'v')
|
||||
->fields('v', array('value'))
|
||||
->fields('v', ['value'])
|
||||
->condition('name', $name)
|
||||
->execute()
|
||||
->fetchField();
|
||||
|
|
|
@ -37,7 +37,7 @@ class Variable extends DrupalSqlBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeIterator() {
|
||||
return new \ArrayIterator(array($this->values()));
|
||||
return new \ArrayIterator([$this->values()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ class Variable extends DrupalSqlBase {
|
|||
public function query() {
|
||||
return $this->getDatabase()
|
||||
->select('variable', 'v')
|
||||
->fields('v', array('name', 'value'))
|
||||
->fields('v', ['name', 'value'])
|
||||
->condition('name', $this->variables, 'IN');
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class VariableMultiRow extends DrupalSqlBase {
|
|||
*/
|
||||
public function query() {
|
||||
return $this->select('variable', 'v')
|
||||
->fields('v', array('name', 'value'))
|
||||
->fields('v', ['name', 'value'])
|
||||
// Cast scalars to array so we can consistently use an IN condition.
|
||||
->condition('name', (array) $this->configuration['variables'], 'IN');
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ class VariableMultiRow extends DrupalSqlBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function fields() {
|
||||
return array(
|
||||
return [
|
||||
'name' => $this->t('Name'),
|
||||
'value' => $this->t('Value'),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@ class Config extends DrupalSqlBase {
|
|||
*/
|
||||
public function query() {
|
||||
$query = $this->select('config', 'c')
|
||||
->fields('c', array('collection', 'name', 'data'));
|
||||
->fields('c', ['collection', 'name', 'data']);
|
||||
if (!empty($this->configuration['collections'])) {
|
||||
$query->condition('collection', (array) $this->configuration['collections'], 'IN');
|
||||
}
|
||||
|
|
|
@ -1772,7 +1772,7 @@ $connection->insert('comments')
|
|||
'uid' => '0',
|
||||
'subject' => 'The first comment.',
|
||||
'comment' => 'The first comment body.',
|
||||
'hostname' => '127.0.0.1',
|
||||
'hostname' => '203.0.113.1',
|
||||
'timestamp' => '1390264918',
|
||||
'status' => '0',
|
||||
'format' => '1',
|
||||
|
@ -1788,7 +1788,7 @@ $connection->insert('comments')
|
|||
'uid' => '0',
|
||||
'subject' => 'The response to the second comment.',
|
||||
'comment' => 'The second comment response body.',
|
||||
'hostname' => '127.0.0.1',
|
||||
'hostname' => '203.0.113.2',
|
||||
'timestamp' => '1390264938',
|
||||
'status' => '0',
|
||||
'format' => '1',
|
||||
|
@ -1804,7 +1804,7 @@ $connection->insert('comments')
|
|||
'uid' => '0',
|
||||
'subject' => 'The second comment.',
|
||||
'comment' => 'The second comment body.',
|
||||
'hostname' => '127.0.0.1',
|
||||
'hostname' => '203.0.113.3',
|
||||
'timestamp' => '1390264948',
|
||||
'status' => '1',
|
||||
'format' => '1',
|
||||
|
@ -3018,7 +3018,7 @@ $connection->insert('content_node_field_instance')
|
|||
'label' => 'Text Single Checkbox Field',
|
||||
'widget_type' => 'text_textfield',
|
||||
'widget_settings' => 'a:4:{s:13:"default_value";a:1:{i:0;a:2:{s:5:"value";s:1:"0";s:14:"_error_element";s:63:"default_value_widget][field_test_text_single_checkbox][0][value";}}s:17:"default_value_php";N;s:4:"rows";i:5;s:4:"size";s:3:"255";}',
|
||||
'display_settings' => 'a:7:{s:6:"weight";s:2:"17";s:6:"parent";s:0:"";i:5;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}s:5:"label";a:1:{s:6:"format";s:5:"above";}s:6:"teaser";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}s:4:"full";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:4;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}}',
|
||||
'display_settings' => 'a:7:{s:6:"weight";s:2:"32";s:6:"parent";s:0:"";s:5:"label";a:1:{s:6:"format";s:5:"above";}s:6:"teaser";a:2:{s:6:"format";s:6:"hidden";s:7:"exclude";i:0;}s:4:"full";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:5;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:4;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}}',
|
||||
'description' => 'An example text field using a single on/off checkbox.',
|
||||
'widget_module' => 'text',
|
||||
'widget_active' => '1',
|
||||
|
@ -45954,8 +45954,32 @@ $connection->insert('variable')
|
|||
'value' => 's:1:"1";',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_page',
|
||||
'value' => 'b:1;',
|
||||
'name' => 'upload_employee',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_event',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_sponsor',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_test_page',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_test_event',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_test_planet',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_test_story',
|
||||
'value' => 'b:0;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'upload_story',
|
||||
|
|
|
@ -2512,7 +2512,7 @@ $connection->insert('comment')
|
|||
'nid' => '1',
|
||||
'uid' => '1',
|
||||
'subject' => 'A comment',
|
||||
'hostname' => '::1',
|
||||
'hostname' => '2001:db8:ffff:ffff:ffff:ffff:ffff:ffff',
|
||||
'created' => '1421727536',
|
||||
'changed' => '1421727536',
|
||||
'status' => '1',
|
||||
|
@ -6141,6 +6141,30 @@ $connection->insert('field_revision_body')
|
|||
'body_summary' => '',
|
||||
'body_format' => 'filtered_html',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'article',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '4',
|
||||
'revision_id' => '4',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'body_value' => 'is - Is that is it awesome.',
|
||||
'body_summary' => '',
|
||||
'body_format' => 'filtered_html',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'article',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '5',
|
||||
'revision_id' => '5',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'body_value' => 'en - Is that is it awesome.',
|
||||
'body_summary' => '',
|
||||
'body_format' => 'filtered_html',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_revision_comment_body', array(
|
||||
|
@ -30945,6 +30969,38 @@ $connection->insert('node')
|
|||
'tnid' => '2',
|
||||
'translate' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '4',
|
||||
'vid' => '4',
|
||||
'type' => 'article',
|
||||
'language' => 'is',
|
||||
'title' => 'is - The thing about Firefly',
|
||||
'uid' => '1',
|
||||
'status' => '1',
|
||||
'created' => '1478755274',
|
||||
'changed' => '1478755274',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'sticky' => '0',
|
||||
'tnid' => '4',
|
||||
'translate' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '5',
|
||||
'vid' => '5',
|
||||
'type' => 'article',
|
||||
'language' => 'en',
|
||||
'title' => 'en - The thing about Firefly',
|
||||
'uid' => '1',
|
||||
'status' => '1',
|
||||
'created' => '1478755314',
|
||||
'changed' => '1478755314',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'sticky' => '0',
|
||||
'tnid' => '4',
|
||||
'translate' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_access', array(
|
||||
|
@ -31089,6 +31145,22 @@ $connection->insert('node_comment_statistics')
|
|||
'last_comment_uid' => '1',
|
||||
'comment_count' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '4',
|
||||
'cid' => '0',
|
||||
'last_comment_timestamp' => '1478755274',
|
||||
'last_comment_name' => NULL,
|
||||
'last_comment_uid' => '1',
|
||||
'comment_count' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '5',
|
||||
'cid' => '0',
|
||||
'last_comment_timestamp' => '1478755314',
|
||||
'last_comment_name' => NULL,
|
||||
'last_comment_uid' => '1',
|
||||
'comment_count' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_counter', array(
|
||||
|
@ -31143,15 +31215,27 @@ $connection->insert('node_counter')
|
|||
->values(array(
|
||||
'nid' => '2',
|
||||
'totalcount' => '1',
|
||||
'daycount' => '1',
|
||||
'daycount' => '0',
|
||||
'timestamp' => '1471428059',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '3',
|
||||
'totalcount' => '1',
|
||||
'daycount' => '1',
|
||||
'daycount' => '0',
|
||||
'timestamp' => '1471428153',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '4',
|
||||
'totalcount' => '1',
|
||||
'daycount' => '1',
|
||||
'timestamp' => '1478755275',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '5',
|
||||
'totalcount' => '1',
|
||||
'daycount' => '1',
|
||||
'timestamp' => '1478755314',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_revision', array(
|
||||
|
@ -31272,6 +31356,30 @@ $connection->insert('node_revision')
|
|||
'promote' => '1',
|
||||
'sticky' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '4',
|
||||
'vid' => '4',
|
||||
'uid' => '1',
|
||||
'title' => 'is - The thing about Firefly',
|
||||
'log' => '',
|
||||
'timestamp' => '1478755274',
|
||||
'status' => '1',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'sticky' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '5',
|
||||
'vid' => '5',
|
||||
'uid' => '1',
|
||||
'title' => 'en - The thing about Firefly',
|
||||
'log' => '',
|
||||
'timestamp' => '1478755314',
|
||||
'status' => '1',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'sticky' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_type', array(
|
||||
|
@ -43027,6 +43135,30 @@ $connection->insert('url_alias')
|
|||
'alias' => 'term33',
|
||||
'language' => 'und',
|
||||
))
|
||||
->values(array(
|
||||
'pid' => '2',
|
||||
'source' => 'node/2',
|
||||
'alias' => 'deep-space-9',
|
||||
'language' => 'en',
|
||||
))
|
||||
->values(array(
|
||||
'pid' => '3',
|
||||
'source' => 'node/3',
|
||||
'alias' => 'deep-space-9-is',
|
||||
'language' => 'is',
|
||||
))
|
||||
->values(array(
|
||||
'pid' => '4',
|
||||
'source' => 'node/4',
|
||||
'alias' => 'firefly-is',
|
||||
'language' => 'is',
|
||||
))
|
||||
->values(array(
|
||||
'pid' => '5',
|
||||
'source' => 'node/5',
|
||||
'alias' => 'firefly',
|
||||
'language' => 'en',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('users', array(
|
||||
|
|
|
@ -14,7 +14,7 @@ class MigrateCckFieldPluginManagerTest extends MigrateDrupalTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = array('system', 'user', 'field', 'migrate_drupal', 'options', 'file', 'text', 'migrate_cckfield_plugin_manager_test');
|
||||
public static $modules = ['system', 'user', 'field', 'migrate_drupal', 'options', 'file', 'text', 'migrate_cckfield_plugin_manager_test'];
|
||||
|
||||
/**
|
||||
* Tests that the correct MigrateCckField plugins are used.
|
||||
|
|
|
@ -15,7 +15,7 @@ abstract class MigrateDrupalTestBase extends MigrateTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('system', 'user', 'field', 'migrate_drupal', 'options', 'file');
|
||||
public static $modules = ['system', 'user', 'field', 'migrate_drupal', 'options', 'file'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -44,12 +44,12 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
|
|||
'uid' => 2,
|
||||
'name' => 'Ford Prefect',
|
||||
'mail' => 'ford.prefect@localhost',
|
||||
'signature' => array(
|
||||
array(
|
||||
'signature' => [
|
||||
[
|
||||
'value' => 'Bring a towel.',
|
||||
'format' => 'filtered_html',
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
'init' => 'proto@zo.an',
|
||||
])->save();
|
||||
|
||||
|
|
|
@ -22,11 +22,11 @@ class MigrateDependenciesTest extends MigrateDrupal6TestBase {
|
|||
* Tests that the order is correct when loading several migrations.
|
||||
*/
|
||||
public function testMigrateDependenciesOrder() {
|
||||
$migration_items = array('d6_comment', 'd6_filter_format', 'd6_node:page');
|
||||
$migration_items = ['d6_comment', 'd6_filter_format', 'd6_node:page'];
|
||||
$migrations = $this->container->get('plugin.manager.migration')->createInstances($migration_items);
|
||||
$expected_order = array('d6_filter_format', 'd6_node:page', 'd6_comment');
|
||||
$expected_order = ['d6_filter_format', 'd6_node:page', 'd6_comment'];
|
||||
$this->assertIdentical(array_keys($migrations), $expected_order);
|
||||
$expected_requirements = array(
|
||||
$expected_requirements = [
|
||||
// d6_comment depends on d6_node:*, which the deriver expands into every
|
||||
// variant of d6_node.
|
||||
'd6_node:article',
|
||||
|
@ -47,7 +47,7 @@ class MigrateDependenciesTest extends MigrateDrupal6TestBase {
|
|||
'd6_comment_type',
|
||||
'd6_comment_entity_display',
|
||||
'd6_comment_entity_form_display',
|
||||
);
|
||||
];
|
||||
// Migration dependencies for comment include dependencies for node
|
||||
// migration as well.
|
||||
$actual_requirements = $migrations['d6_comment']->get('requirements');
|
||||
|
@ -66,7 +66,7 @@ class MigrateDependenciesTest extends MigrateDrupal6TestBase {
|
|||
$executable = new MigrateExecutable($migration, $this);
|
||||
$this->startCollectingMessages();
|
||||
$executable->import();
|
||||
$this->assertEqual($this->migrateMessages['error'], array(SafeMarkup::format('Migration @id did not meet the requirements. Missing migrations d6_aggregator_feed. requirements: d6_aggregator_feed.', array('@id' => $migration->id()))));
|
||||
$this->assertEqual($this->migrateMessages['error'], [SafeMarkup::format('Migration @id did not meet the requirements. Missing migrations d6_aggregator_feed. requirements: d6_aggregator_feed.', ['@id' => $migration->id()])]);
|
||||
$this->collectMessages = FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ class DrupalSqlBaseTest extends MigrateTestCase {
|
|||
/**
|
||||
* Define bare minimum migration configuration.
|
||||
*/
|
||||
protected $migrationConfiguration = array(
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'DrupalSqlBase',
|
||||
);
|
||||
];
|
||||
|
||||
/**
|
||||
* @var \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase
|
||||
|
@ -26,17 +26,17 @@ class DrupalSqlBaseTest extends MigrateTestCase {
|
|||
/**
|
||||
* Minimum database contents needed to test DrupalSqlBase.
|
||||
*/
|
||||
protected $databaseContents = array(
|
||||
'system' => array(
|
||||
array(
|
||||
protected $databaseContents = [
|
||||
'system' => [
|
||||
[
|
||||
'filename' => 'sites/all/modules/module1',
|
||||
'name' => 'module1',
|
||||
'type' => 'module',
|
||||
'status' => 0,
|
||||
'schema_version' => -1,
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* @covers ::checkRequirements
|
||||
|
|
|
@ -14,27 +14,27 @@ abstract class VariableMultiRowTestBase extends MigrateSqlSourceTestCase {
|
|||
const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\VariableMultiRow';
|
||||
|
||||
// The fake Migration configuration entity.
|
||||
protected $migrationConfiguration = array(
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'test',
|
||||
'source' => array(
|
||||
'source' => [
|
||||
'plugin' => 'd6_variable_multirow',
|
||||
'variables' => array(
|
||||
'variables' => [
|
||||
'foo',
|
||||
'bar',
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
protected $expectedResults = array(
|
||||
array('name' => 'foo', 'value' => 1),
|
||||
array('name' => 'bar', 'value' => FALSE),
|
||||
);
|
||||
protected $expectedResults = [
|
||||
['name' => 'foo', 'value' => 1],
|
||||
['name' => 'bar', 'value' => FALSE],
|
||||
];
|
||||
|
||||
protected $databaseContents = array(
|
||||
'variable' => array(
|
||||
array('name' => 'foo', 'value' => 'i:1;'),
|
||||
array('name' => 'bar', 'value' => 'b:0;'),
|
||||
),
|
||||
);
|
||||
protected $databaseContents = [
|
||||
'variable' => [
|
||||
['name' => 'foo', 'value' => 'i:1;'],
|
||||
['name' => 'bar', 'value' => 'b:0;'],
|
||||
],
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
@ -13,31 +13,31 @@ class VariableTest extends MigrateSqlSourceTestCase {
|
|||
|
||||
const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\Variable';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'test',
|
||||
'highWaterProperty' => array('field' => 'test'),
|
||||
'source' => array(
|
||||
'highWaterProperty' => ['field' => 'test'],
|
||||
'source' => [
|
||||
'plugin' => 'd6_variable',
|
||||
'variables' => array(
|
||||
'variables' => [
|
||||
'foo',
|
||||
'bar',
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
protected $expectedResults = [
|
||||
[
|
||||
'id' => 'foo',
|
||||
'foo' => 1,
|
||||
'bar' => FALSE,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
|
||||
protected $databaseContents = array(
|
||||
'variable' => array(
|
||||
array('name' => 'foo', 'value' => 'i:1;'),
|
||||
array('name' => 'bar', 'value' => 'b:0;'),
|
||||
),
|
||||
);
|
||||
protected $databaseContents = [
|
||||
'variable' => [
|
||||
['name' => 'foo', 'value' => 'i:1;'],
|
||||
['name' => 'bar', 'value' => 'b:0;'],
|
||||
],
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
|
|||
/**
|
||||
* Define bare minimum migration configuration.
|
||||
*/
|
||||
protected $migrationConfiguration = array(
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'Drupal6SqlBase',
|
||||
);
|
||||
];
|
||||
|
||||
/**
|
||||
* @var \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase
|
||||
|
@ -31,37 +31,37 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
|
|||
/**
|
||||
* Minimum database contents needed to test Drupal6SqlBase.
|
||||
*/
|
||||
protected $databaseContents = array(
|
||||
'system' => array(
|
||||
array(
|
||||
protected $databaseContents = [
|
||||
'system' => [
|
||||
[
|
||||
'filename' => 'sites/all/modules/module1',
|
||||
'name' => 'module1',
|
||||
'type' => 'module',
|
||||
'status' => 1,
|
||||
'schema_version' => -1,
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'filename' => 'sites/all/modules/module2',
|
||||
'name' => 'module2',
|
||||
'type' => 'module',
|
||||
'status' => 0,
|
||||
'schema_version' => 7201,
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
'filename' => 'sites/all/modules/test2',
|
||||
'name' => 'test2',
|
||||
'type' => 'theme',
|
||||
'status' => 1,
|
||||
'schema_version' => -1,
|
||||
),
|
||||
),
|
||||
'variable' => array(
|
||||
array(
|
||||
],
|
||||
],
|
||||
'variable' => [
|
||||
[
|
||||
'name' => 'my_variable',
|
||||
'value' => 'b:1;',
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -72,7 +72,7 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
|
|||
$state = $this->getMock('Drupal\Core\State\StateInterface');
|
||||
/** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */
|
||||
$entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
|
||||
$this->base = new TestDrupal6SqlBase($this->migrationConfiguration, $plugin, array(), $this->getMigration(), $state, $entity_manager);
|
||||
$this->base = new TestDrupal6SqlBase($this->migrationConfiguration, $plugin, [], $this->getMigration(), $state, $entity_manager);
|
||||
$this->base->setDatabase($this->getDatabase($this->databaseContents));
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function fields() {
|
||||
return array(
|
||||
return [
|
||||
'filename' => t('The path of the primary file for this item.'),
|
||||
'name' => t('The name of the item; e.g. node.'),
|
||||
'type' => t('The type of the item, either module, theme, or theme_engine.'),
|
||||
|
@ -154,7 +154,7 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
|
|||
'schema_version' => t('The module\'s database schema version number.'),
|
||||
'weight' => t('The order in which this module\'s hooks should be invoked.'),
|
||||
'info' => t('A serialized array containing information from the module\'s .info file.'),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,7 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
|
|||
public function query() {
|
||||
$query = $this->database
|
||||
->select('system', 's')
|
||||
->fields('s', array('filename', 'name', 'schema_version'));
|
||||
->fields('s', ['filename', 'name', 'schema_version']);
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIds() {
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class i18nVariableTest extends MigrateSqlSourceTestCase {
|
|||
*/
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'test',
|
||||
'highWaterProperty' => array('field' => 'test'),
|
||||
'highWaterProperty' => ['field' => 'test'],
|
||||
'source' => [
|
||||
'plugin' => 'i18n_variable',
|
||||
'variables' => [
|
||||
|
@ -51,10 +51,10 @@ class i18nVariableTest extends MigrateSqlSourceTestCase {
|
|||
*/
|
||||
protected $databaseContents = [
|
||||
'i18n_variable' => [
|
||||
array('name' => 'site_slogan', 'language' => 'fr', 'value' => 's:19:"Migrate est génial";'),
|
||||
array('name' => 'site_name', 'language' => 'fr', 'value' => 's:11:"nom de site";'),
|
||||
array('name' => 'site_slogan', 'language' => 'mi', 'value' => 's:19:"Ko whakamataku heke";'),
|
||||
array('name' => 'site_name', 'language' => 'mi', 'value' => 's:9:"ingoa_pae";'),
|
||||
['name' => 'site_slogan', 'language' => 'fr', 'value' => 's:19:"Migrate est génial";'],
|
||||
['name' => 'site_name', 'language' => 'fr', 'value' => 's:11:"nom de site";'],
|
||||
['name' => 'site_slogan', 'language' => 'mi', 'value' => 's:19:"Ko whakamataku heke";'],
|
||||
['name' => 'site_name', 'language' => 'mi', 'value' => 's:9:"ingoa_pae";'],
|
||||
],
|
||||
];
|
||||
|
||||
|
|
Reference in a new issue