3 namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7;
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
8 * Tests D7 comment source plugin.
10 * @covers \Drupal\comment\Plugin\migrate\source\d7\Comment
13 class CommentTest extends MigrateSqlSourceTestBase {
18 public static $modules = ['comment', 'migrate_drupal'];
23 public function providerSource() {
27 $tests[0]['source_data']['comment'] = [
33 'subject' => 'A comment',
35 'created' => '1421727536',
36 'changed' => '1421727536',
45 $tests[0]['source_data']['node'] = [
49 'type' => 'test_content_type',
54 'created' => '1421727515',
55 'changed' => '1421727515',
63 $tests[0]['source_data']['field_config'] = [
66 'translatable' => '0',
70 'translatable' => '1',
73 $tests[0]['source_data']['field_config_instance'] = [
77 'field_name' => 'comment_body',
78 'entity_type' => 'comment',
79 'bundle' => 'comment_node_test_content_type',
86 'field_name' => 'subject_field',
87 'entity_type' => 'comment',
88 'bundle' => 'comment_node_test_content_type',
93 $tests[0]['source_data']['field_data_comment_body'] = [
95 'entity_type' => 'comment',
96 'bundle' => 'comment_node_test_content_type',
102 'comment_body_value' => 'This is a comment',
103 'comment_body_format' => 'filtered_html',
106 $tests[0]['source_data']['field_data_subject_field'] = [
108 'entity_type' => 'comment',
109 'bundle' => 'comment_node_test_content_type',
112 'revision_id' => '1',
115 'subject_field_value' => 'A comment (subject_field)',
116 'subject_field_format' => NULL,
119 $tests[0]['source_data']['system'] = [
127 // The expected results.
128 $tests[0]['expected_data'] = [
134 'subject' => 'A comment (subject_field)',
136 'created' => '1421727536',
137 'changed' => '1421727536',
146 'value' => 'This is a comment',
147 'format' => 'filtered_html',