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
|
@ -246,10 +246,12 @@ display:
|
|||
hide_empty: false
|
||||
empty_zero: false
|
||||
hide_alter_empty: true
|
||||
date_format: long
|
||||
custom_date_format: ''
|
||||
timezone: ''
|
||||
plugin_id: date
|
||||
type: timestamp
|
||||
settings:
|
||||
date_format: long
|
||||
custom_date_format: ''
|
||||
timezone: ''
|
||||
plugin_id: field
|
||||
comment_body:
|
||||
id: comment_body
|
||||
table: comment__comment_body
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- comment
|
||||
- node
|
||||
- user
|
||||
id: '2505879'
|
||||
label: '2505879'
|
||||
module: views
|
||||
description: ''
|
||||
tag: ''
|
||||
base_table: node_field_data
|
||||
base_field: nid
|
||||
core: 8.x
|
||||
display:
|
||||
default:
|
||||
display_plugin: default
|
||||
id: default
|
||||
display_title: Master
|
||||
position: 0
|
||||
display_options:
|
||||
access:
|
||||
type: perm
|
||||
options:
|
||||
perm: 'access content'
|
||||
cache:
|
||||
type: tag
|
||||
options: { }
|
||||
query:
|
||||
type: views_query
|
||||
options:
|
||||
disable_sql_rewrite: false
|
||||
distinct: false
|
||||
replica: false
|
||||
query_comment: ''
|
||||
query_tags: { }
|
||||
pager:
|
||||
type: full
|
||||
style:
|
||||
type: table
|
||||
row:
|
||||
type: fields
|
||||
fields:
|
||||
title:
|
||||
id: title
|
||||
table: node_field_data
|
||||
field: title
|
||||
entity_type: node
|
||||
entity_field: title
|
||||
alter:
|
||||
alter_text: false
|
||||
make_link: false
|
||||
absolute: false
|
||||
trim: false
|
||||
word_boundary: false
|
||||
ellipsis: false
|
||||
strip_tags: false
|
||||
html: false
|
||||
hide_empty: false
|
||||
empty_zero: false
|
||||
settings:
|
||||
link_to_entity: true
|
||||
plugin_id: field
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: Title
|
||||
exclude: false
|
||||
element_type: ''
|
||||
element_class: ''
|
||||
element_label_type: ''
|
||||
element_label_class: ''
|
||||
element_label_colon: true
|
||||
element_wrapper_type: ''
|
||||
element_wrapper_class: ''
|
||||
element_default_classes: true
|
||||
empty: ''
|
||||
hide_alter_empty: true
|
||||
click_sort_column: value
|
||||
type: string
|
||||
group_column: value
|
||||
group_columns: { }
|
||||
group_rows: true
|
||||
delta_limit: 0
|
||||
delta_offset: 0
|
||||
delta_reversed: false
|
||||
delta_first_last: false
|
||||
multi_type: separator
|
||||
separator: ', '
|
||||
field_api_classes: false
|
||||
new_comments:
|
||||
id: new_comments
|
||||
table: node
|
||||
field: new_comments
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: 'New comments'
|
||||
exclude: false
|
||||
alter:
|
||||
alter_text: false
|
||||
text: ''
|
||||
make_link: false
|
||||
path: ''
|
||||
absolute: false
|
||||
external: false
|
||||
replace_spaces: false
|
||||
path_case: none
|
||||
trim_whitespace: false
|
||||
alt: ''
|
||||
rel: ''
|
||||
link_class: ''
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
target: ''
|
||||
nl2br: false
|
||||
max_length: 0
|
||||
word_boundary: true
|
||||
ellipsis: true
|
||||
more_link: false
|
||||
more_link_text: ''
|
||||
more_link_path: ''
|
||||
strip_tags: false
|
||||
trim: false
|
||||
preserve_tags: ''
|
||||
html: false
|
||||
element_type: ''
|
||||
element_class: ''
|
||||
element_label_type: ''
|
||||
element_label_class: ''
|
||||
element_label_colon: true
|
||||
element_wrapper_type: ''
|
||||
element_wrapper_class: ''
|
||||
element_default_classes: true
|
||||
empty: ''
|
||||
hide_empty: false
|
||||
empty_zero: false
|
||||
hide_alter_empty: true
|
||||
set_precision: false
|
||||
precision: 0
|
||||
decimal: .
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
link_to_comment: true
|
||||
entity_type: node
|
||||
plugin_id: node_new_comments
|
||||
filters: { }
|
||||
sorts: { }
|
||||
title: ''
|
||||
header: { }
|
||||
footer: { }
|
||||
empty: { }
|
||||
relationships: { }
|
||||
arguments: { }
|
||||
display_extenders: { }
|
||||
page_1:
|
||||
display_plugin: page
|
||||
id: page_1
|
||||
display_title: Page
|
||||
position: 1
|
||||
display_options:
|
||||
path: 'test-new-comments'
|
|
@ -45,6 +45,10 @@ class CommentLockTest extends UnitTestCase {
|
|||
$lock->expects($this->exactly(2))
|
||||
->method($this->anything());
|
||||
$container->set('lock', $lock);
|
||||
|
||||
$cache_tag_invalidator = $this->getMock('Drupal\Core\Cache\CacheTagsInvalidator');
|
||||
$container->set('cache_tags.invalidator', $cache_tag_invalidator);
|
||||
|
||||
\Drupal::setContainer($container);
|
||||
$methods = get_class_methods('Drupal\comment\Entity\Comment');
|
||||
unset($methods[array_search('preSave', $methods)]);
|
||||
|
@ -70,6 +74,14 @@ class CommentLockTest extends UnitTestCase {
|
|||
->method('getThread')
|
||||
->will($this->returnValue(''));
|
||||
|
||||
$parent_entity = $this->getMock('\Drupal\Core\Entity\ContentEntityInterface');
|
||||
$parent_entity->expects($this->atLeastOnce())
|
||||
->method('getCacheTagsToInvalidate')
|
||||
->willReturn(['node:1']);
|
||||
$comment->expects($this->once())
|
||||
->method('getCommentedEntity')
|
||||
->willReturn($parent_entity);
|
||||
|
||||
$entity_type = $this->getMock('\Drupal\Core\Entity\EntityTypeInterface');
|
||||
$comment->expects($this->any())
|
||||
->method('getEntityType')
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\comment\Unit\Migrate\d6\CommentSourceWithHighWaterTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\comment\Unit\Migrate\d6;
|
||||
|
||||
/**
|
||||
* Tests the Drupal 6 comment source w/ high water handling.
|
||||
*
|
||||
* @group comment
|
||||
*/
|
||||
class CommentSourceWithHighWaterTest extends CommentTestBase {
|
||||
|
||||
const ORIGINAL_HIGH_WATER = 1382255613;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->migrationConfiguration['highWaterProperty']['field'] = 'timestamp';
|
||||
array_shift($this->expectedResults);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\comment\Unit\Migrate\d6\CommentTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\comment\Unit\Migrate\d6;
|
||||
|
||||
/**
|
||||
* Tests D6 comment source plugin.
|
||||
*
|
||||
* @group comment
|
||||
*/
|
||||
class CommentTest extends CommentTestBase {
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\comment\Unit\Migrate\d6\CommentTestBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\comment\Unit\Migrate\d6;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Base class for comment source unit tests.
|
||||
*/
|
||||
abstract class CommentTestBase extends MigrateSqlSourceTestCase {
|
||||
|
||||
// The plugin system is not working during unit testing so the source plugin
|
||||
// class needs to be manually specified.
|
||||
const PLUGIN_CLASS = 'Drupal\comment\Plugin\migrate\source\d6\Comment';
|
||||
|
||||
// The fake Migration configuration entity.
|
||||
protected $migrationConfiguration = array(
|
||||
// The ID of the entity, can be any string.
|
||||
'id' => 'test',
|
||||
// This needs to be the identifier of the actual key: cid for comment, nid
|
||||
// for node and so on.
|
||||
'source' => array(
|
||||
'plugin' => 'd6_comment',
|
||||
),
|
||||
);
|
||||
|
||||
// We need to set up the database contents; it's easier to do that below.
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'cid' => 1,
|
||||
'pid' => 0,
|
||||
'nid' => 2,
|
||||
'uid' => 3,
|
||||
'subject' => 'subject value 1',
|
||||
'comment' => 'comment value 1',
|
||||
'hostname' => 'hostname value 1',
|
||||
'timestamp' => 1382255613,
|
||||
'status' => 1,
|
||||
'thread' => '',
|
||||
'name' => '',
|
||||
'mail' => '',
|
||||
'homepage' => '',
|
||||
'format' => 'testformat1',
|
||||
'type' => 'story',
|
||||
),
|
||||
array(
|
||||
'cid' => 2,
|
||||
'pid' => 1,
|
||||
'nid' => 3,
|
||||
'uid' => 4,
|
||||
'subject' => 'subject value 2',
|
||||
'comment' => 'comment value 2',
|
||||
'hostname' => 'hostname value 2',
|
||||
'timestamp' => 1382255662,
|
||||
'status' => 1,
|
||||
'thread' => '',
|
||||
'name' => '',
|
||||
'mail' => '',
|
||||
'homepage' => '',
|
||||
'format' => 'testformat2',
|
||||
'type' => 'page',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
foreach ($this->expectedResults as $k => $row) {
|
||||
$this->databaseContents['comments'][$k] = $row;
|
||||
$this->databaseContents['comments'][$k]['status'] = 1 - $this->databaseContents['comments'][$k]['status'];
|
||||
}
|
||||
// Add node table data.
|
||||
$this->databaseContents['node'][] = array('nid' => 2, 'type' => 'story');
|
||||
$this->databaseContents['node'][] = array('nid' => 3, 'type' => 'page');
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
105
core/modules/comment/tests/src/Unit/Migrate/d7/CommentTest.php
Normal file
105
core/modules/comment/tests/src/Unit/Migrate/d7/CommentTest.php
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\comment\Unit\Migrate\d7\CommentTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\comment\Unit\Migrate\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Tests D7 comment source plugin.
|
||||
*
|
||||
* @group comment
|
||||
*/
|
||||
class CommentTest extends MigrateSqlSourceTestCase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\comment\Plugin\migrate\source\d7\Comment';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
'source' => array(
|
||||
'plugin' => 'd7_comment',
|
||||
),
|
||||
);
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'cid' => '1',
|
||||
'pid' => '0',
|
||||
'nid' => '1',
|
||||
'uid' => '1',
|
||||
'subject' => 'A comment',
|
||||
'hostname' => '::1',
|
||||
'created' => '1421727536',
|
||||
'changed' => '1421727536',
|
||||
'status' => '1',
|
||||
'thread' => '01/',
|
||||
'name' => 'admin',
|
||||
'mail' => '',
|
||||
'homepage' => '',
|
||||
'language' => 'und',
|
||||
'comment_body' => array(
|
||||
array(
|
||||
'value' => 'This is a comment',
|
||||
'format' => 'filtered_html',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['comment'] = $this->expectedResults;
|
||||
unset($this->databaseContents['comment'][0]['comment_body']);
|
||||
|
||||
$this->databaseContents['node'] = array(
|
||||
array(
|
||||
'nid' => '1',
|
||||
'vid' => '1',
|
||||
'type' => 'test_content_type',
|
||||
'language' => 'en',
|
||||
'title' => 'A Node',
|
||||
'uid' => '1',
|
||||
'status' => '1',
|
||||
'created' => '1421727515',
|
||||
'changed' => '1421727515',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'sticky' => '0',
|
||||
'tnid' => '0',
|
||||
'translate' => '0',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['field_config_instance'] = array(
|
||||
array(
|
||||
'id' => '14',
|
||||
'field_id' => '1',
|
||||
'field_name' => 'comment_body',
|
||||
'entity_type' => 'comment',
|
||||
'bundle' => 'comment_node_test_content_type',
|
||||
'data' => 'a:0:{}',
|
||||
'deleted' => '0',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['field_data_comment_body'] = array(
|
||||
array(
|
||||
'entity_type' => 'comment',
|
||||
'bundle' => 'comment_node_test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'comment_body_value' => 'This is a comment',
|
||||
'comment_body_format' => 'filtered_html',
|
||||
),
|
||||
);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\comment\Unit\Migrate\d7\CommentTypeTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\comment\Unit\Migrate\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Tests D7 comment type source plugin.
|
||||
*
|
||||
* @group comment
|
||||
*/
|
||||
class CommentTypeTest extends MigrateSqlSourceTestCase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\comment\Plugin\migrate\source\d7\CommentType';
|
||||
|
||||
protected $migrationConfiguration = array(
|
||||
'id' => 'test',
|
||||
'source' => array(
|
||||
'plugin' => 'd7_comment_type',
|
||||
),
|
||||
);
|
||||
|
||||
protected $expectedResults = array(
|
||||
array(
|
||||
'bundle' => 'comment_node_article',
|
||||
'node_type' => 'article',
|
||||
'default_mode' => '1',
|
||||
'per_page' => '50',
|
||||
'anonymous' => '0',
|
||||
'form_location' => '1',
|
||||
'preview' => '0',
|
||||
'subject' => '1',
|
||||
'label' => 'Article comment',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['node_type'] = array(
|
||||
array(
|
||||
'type' => 'article',
|
||||
'name' => 'Article',
|
||||
'base' => 'node_content',
|
||||
'module' => 'node',
|
||||
'description' => 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.',
|
||||
'help' => 'Help text for articles',
|
||||
'has_title' => '1',
|
||||
'title_label' => 'Title',
|
||||
'custom' => '1',
|
||||
'modified' => '1',
|
||||
'locked' => '0',
|
||||
'disabled' => '0',
|
||||
'orig_type' => 'article',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['field_config_instance'] = array(
|
||||
array(
|
||||
'id' => '14',
|
||||
'field_id' => '1',
|
||||
'field_name' => 'comment_body',
|
||||
'entity_type' => 'comment',
|
||||
'bundle' => 'comment_node_article',
|
||||
'data' => 'a:0:{}',
|
||||
'deleted' => '0',
|
||||
),
|
||||
);
|
||||
$this->databaseContents['variable'] = array(
|
||||
array(
|
||||
'name' => 'comment_default_mode_article',
|
||||
'value' => serialize(1),
|
||||
),
|
||||
array(
|
||||
'name' => 'comment_per_page_article',
|
||||
'value' => serialize(50),
|
||||
),
|
||||
array(
|
||||
'name' => 'comment_anonymous_article',
|
||||
'value' => serialize(0),
|
||||
),
|
||||
array(
|
||||
'name' => 'comment_form_location_article',
|
||||
'value' => serialize(1),
|
||||
),
|
||||
array(
|
||||
'name' => 'comment_preview_article',
|
||||
'value' => serialize(0),
|
||||
),
|
||||
array(
|
||||
'name' => 'comment_subject_article',
|
||||
'value' => serialize(1),
|
||||
),
|
||||
);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue