Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -21,8 +21,6 @@ class NodeByNodeTypeTest extends MigrateSqlSourceTestCase {
|
|||
// The fake Migration configuration entity.
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
// Leave it empty for now.
|
||||
'idlist' => array(),
|
||||
// The fake configuration for the source.
|
||||
'source' => array(
|
||||
'plugin' => 'd6_node',
|
||||
|
|
|
@ -21,8 +21,6 @@ class NodeRevisionByNodeTypeTest extends MigrateSqlSourceTestCase {
|
|||
// The fake Migration configuration entity.
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'test',
|
||||
// Leave it empty for now.
|
||||
'idlist' => [],
|
||||
// The fake configuration for the source.
|
||||
'source' => [
|
||||
'plugin' => 'd6_node_revision',
|
||||
|
|
|
@ -21,8 +21,6 @@ class NodeRevisionTest extends MigrateSqlSourceTestCase {
|
|||
// The fake Migration configuration entity.
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'test',
|
||||
// Leave it empty for now.
|
||||
'idlist' => [],
|
||||
// The fake configuration for the source.
|
||||
'source' => [
|
||||
'plugin' => 'd6_node_revision',
|
||||
|
|
|
@ -18,12 +18,8 @@ class NodeTest extends MigrateSqlSourceTestCase {
|
|||
|
||||
const PLUGIN_CLASS = 'Drupal\node\Plugin\migrate\source\d6\Node';
|
||||
|
||||
// The fake Migration configuration entity.
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
// Leave it empty for now.
|
||||
'idlist' => array(),
|
||||
// The fake configuration for the source.
|
||||
'source' => array(
|
||||
'plugin' => 'd6_node',
|
||||
),
|
||||
|
@ -79,10 +75,9 @@ class NodeTest extends MigrateSqlSourceTestCase {
|
|||
'format' => 1,
|
||||
),
|
||||
array(
|
||||
// Node fields.
|
||||
'nid' => 5,
|
||||
'vid' => 5,
|
||||
'type' => 'article',
|
||||
'type' => 'story',
|
||||
'language' => 'en',
|
||||
'title' => 'node title 5',
|
||||
'uid' => 1,
|
||||
|
@ -101,6 +96,9 @@ class NodeTest extends MigrateSqlSourceTestCase {
|
|||
'log' => '',
|
||||
'timestamp' => 1279308993,
|
||||
'format' => 1,
|
||||
'field_test_four' => array(
|
||||
array('value' => '3.14159'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -108,6 +106,50 @@ class NodeTest extends MigrateSqlSourceTestCase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['content_node_field'] = array(
|
||||
array(
|
||||
'field_name' => 'field_test_four',
|
||||
'type' => 'number_float',
|
||||
'global_settings' => 'a:0:{}',
|
||||
'required' => '0',
|
||||
'multiple' => '0',
|
||||
'db_storage' => '1',
|
||||
'module' => 'number',
|
||||
'db_columns' => 'a:1:{s:5:"value";a:3:{s:4:"type";s:5:"float";s:8:"not null";b:0;s:8:"sortable";b:1;}}',
|
||||
'active' => '1',
|
||||
'locked' => '0',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['content_node_field_instance'] = array(
|
||||
array(
|
||||
'field_name' => 'field_test_four',
|
||||
'type_name' => 'story',
|
||||
'weight' => '3',
|
||||
'label' => 'Float Field',
|
||||
'widget_type' => 'number',
|
||||
'widget_settings' => 'a:0:{}',
|
||||
'display_settings' => 'a:0:{}',
|
||||
'description' => 'An example float field.',
|
||||
'widget_module' => 'number',
|
||||
'widget_active' => '1',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['content_type_story'] = array(
|
||||
array(
|
||||
'nid' => 5,
|
||||
'vid' => 5,
|
||||
'uid' => 5,
|
||||
'field_test_four_value' => '3.14159',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['system'] = array(
|
||||
array(
|
||||
'type' => 'module',
|
||||
'name' => 'content',
|
||||
'schema_version' => 6001,
|
||||
'status' => TRUE,
|
||||
),
|
||||
);
|
||||
foreach ($this->expectedResults as $k => $row) {
|
||||
foreach (array('nid', 'vid', 'title', 'uid', 'body', 'teaser', 'format', 'timestamp', 'log') as $field) {
|
||||
$this->databaseContents['node_revisions'][$k][$field] = $row[$field];
|
||||
|
|
|
@ -24,8 +24,6 @@ class NodeTypeTest extends MigrateSqlSourceTestCase {
|
|||
protected $migrationConfiguration = array(
|
||||
// The ID of the entity, can be any string.
|
||||
'id' => 'test_nodetypes',
|
||||
// Leave it empty for now.
|
||||
'idlist' => array(),
|
||||
'source' => array(
|
||||
'plugin' => 'd6_nodetype',
|
||||
),
|
||||
|
|
|
@ -24,8 +24,6 @@ class ViewModeTest extends MigrateSqlSourceTestCase {
|
|||
protected $migrationConfiguration = array(
|
||||
// The ID of the entity, can be any string.
|
||||
'id' => 'view_mode_test',
|
||||
// Leave it empty for now.
|
||||
'idlist' => array(),
|
||||
'source' => array(
|
||||
'plugin' => 'd6_field_instance_view_mode',
|
||||
),
|
||||
|
|
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\node\Unit\Plugin\migrate\source\d7\NodeTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\node\Unit\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Tests D7 node source plugin.
|
||||
*
|
||||
* @group node
|
||||
*/
|
||||
class NodeTest extends MigrateSqlSourceTestCase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\node\Plugin\migrate\source\d7\Node';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
'source' => array(
|
||||
'plugin' => 'd7_node',
|
||||
),
|
||||
);
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
// Node fields.
|
||||
'nid' => 1,
|
||||
'vid' => 1,
|
||||
'type' => 'page',
|
||||
'language' => 'en',
|
||||
'title' => 'node title 1',
|
||||
'uid' => 1,
|
||||
'status' => 1,
|
||||
'created' => 1279051598,
|
||||
'changed' => 1279051598,
|
||||
'comment' => 2,
|
||||
'promote' => 1,
|
||||
'sticky' => 0,
|
||||
'tnid' => 0,
|
||||
'translate' => 0,
|
||||
'log' => '',
|
||||
'timestamp' => 1279051598,
|
||||
),
|
||||
array(
|
||||
// Node fields.
|
||||
'nid' => 2,
|
||||
'vid' => 2,
|
||||
'type' => 'page',
|
||||
'language' => 'en',
|
||||
'title' => 'node title 2',
|
||||
'uid' => 1,
|
||||
'status' => 1,
|
||||
'created' => 1279290908,
|
||||
'changed' => 1279308993,
|
||||
'comment' => 0,
|
||||
'promote' => 1,
|
||||
'sticky' => 0,
|
||||
'tnid' => 0,
|
||||
'translate' => 0,
|
||||
'log' => '',
|
||||
'timestamp' => 1279308993,
|
||||
),
|
||||
array(
|
||||
// Node fields.
|
||||
'nid' => 5,
|
||||
'vid' => 5,
|
||||
'type' => 'article',
|
||||
'language' => 'en',
|
||||
'title' => 'node title 5',
|
||||
'uid' => 1,
|
||||
'status' => 1,
|
||||
'created' => 1279290908,
|
||||
'changed' => 1279308993,
|
||||
'comment' => 0,
|
||||
'promote' => 1,
|
||||
'sticky' => 0,
|
||||
'tnid' => 0,
|
||||
'translate' => 0,
|
||||
'log' => '',
|
||||
'timestamp' => 1279308993,
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
foreach ($this->expectedResults as $k => $row) {
|
||||
foreach (array('nid', 'vid', 'title', 'uid', 'timestamp', 'log') as $field) {
|
||||
$this->databaseContents['node_revision'][$k][$field] = $row[$field];
|
||||
switch ($field) {
|
||||
case 'nid': case 'vid':
|
||||
break;
|
||||
case 'uid':
|
||||
$this->databaseContents['node_revision'][$k]['uid']++;
|
||||
break;
|
||||
default:
|
||||
unset($row[$field]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->databaseContents['node'][$k] = $row;
|
||||
}
|
||||
array_walk($this->expectedResults, function (&$row) {
|
||||
$row['node_uid'] = $row['uid'];
|
||||
$row['revision_uid'] = $row['uid'] + 1;
|
||||
unset($row['uid']);
|
||||
});
|
||||
|
||||
$this->databaseContents['field_config_instance'] = array(
|
||||
array(
|
||||
'id' => '2',
|
||||
'field_id' => '2',
|
||||
'field_name' => 'body',
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'page',
|
||||
'data' => 'a:0:{}',
|
||||
'deleted' => '0',
|
||||
),
|
||||
array(
|
||||
'id' => '2',
|
||||
'field_id' => '2',
|
||||
'field_name' => 'body',
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'article',
|
||||
'data' => 'a:0:{}',
|
||||
'deleted' => '0',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['field_revision_body'] = array(
|
||||
array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'page',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'en',
|
||||
'delta' => '0',
|
||||
'body_value' => 'Foobaz',
|
||||
'body_summary' => '',
|
||||
'body_format' => 'filtered_html',
|
||||
),
|
||||
);
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\node\Unit\Plugin\migrate\source\d7\NodeTypeTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\node\Unit\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Tests D7 node type source plugin.
|
||||
*
|
||||
* @group node
|
||||
*/
|
||||
class NodeTypeTest extends MigrateSqlSourceTestCase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\node\Plugin\migrate\source\d7\NodeType';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test_nodetypes',
|
||||
'source' => array(
|
||||
'plugin' => 'd7_node_type',
|
||||
),
|
||||
);
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'type' => 'page',
|
||||
'name' => 'Page',
|
||||
'base' => 'node',
|
||||
'description' => 'A <em>page</em>, similar in form to a <em>story</em>, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a <em>page</em> entry does not allow visitor comments and is not featured on the site\'s initial home page.',
|
||||
'help' => '',
|
||||
'title_label' => 'Title',
|
||||
'custom' => 1,
|
||||
'modified' => 0,
|
||||
'locked' => 0,
|
||||
'disabled' => 0,
|
||||
'orig_type' => 'page',
|
||||
),
|
||||
array(
|
||||
'type' => 'story',
|
||||
'name' => 'Story',
|
||||
'base' => 'node',
|
||||
'description' => 'A <em>story</em>, similar in form to a <em>page</em>, is ideal for creating and displaying content that informs or engages website visitors. Press releases, site announcements, and informal blog-like entries may all be created with a <em>story</em> entry. By default, a <em>story</em> entry is automatically featured on the site\'s initial home page, and provides the ability to post comments.',
|
||||
'help' => '',
|
||||
'title_label' => 'Title',
|
||||
'custom' => 1,
|
||||
'modified' => 0,
|
||||
'locked' => 0,
|
||||
'disabled' => 0,
|
||||
'orig_type' => 'story',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Prepopulate contents with results.
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['node_type'] = $this->expectedResults;
|
||||
$this->databaseContents['variable'] = array(
|
||||
array(
|
||||
'name' => 'node_options_page',
|
||||
'value' => 'a:1:{i:0;s:6:"status";}',
|
||||
),
|
||||
array(
|
||||
'name' => 'node_options_story',
|
||||
'value' => 'a:1:{i:0;s:6:"status";}',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['field_config_instance'] = array(
|
||||
array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'page',
|
||||
'field_name' => 'body',
|
||||
'data' => 'a:1:{s:5:"label";s:4:"Body";}',
|
||||
),
|
||||
array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'story',
|
||||
'field_name' => 'body',
|
||||
'data' => 'a:1:{s:5:"label";s:4:"Body";}',
|
||||
)
|
||||
);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue