3 namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7;
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
8 * Tests D7 comment type source plugin.
10 * @covers \Drupal\comment\Plugin\migrate\source\d7\CommentType
13 class CommentTypeTest extends MigrateSqlSourceTestBase {
18 public static $modules = ['comment', 'migrate_drupal'];
23 public function providerSource() {
27 $tests[0]['source_data']['node_type'] = [
31 'base' => 'node_content',
33 'description' => 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.',
34 'help' => 'Help text for articles',
36 'title_label' => 'Title',
41 'orig_type' => 'article',
44 $tests[0]['source_data']['field_config_instance'] = [
48 'field_name' => 'comment_body',
49 'entity_type' => 'comment',
50 'bundle' => 'comment_node_article',
55 $tests[0]['source_data']['variable'] = [
57 'name' => 'comment_default_mode_article',
58 'value' => serialize(1),
61 'name' => 'comment_per_page_article',
62 'value' => serialize(50),
65 'name' => 'comment_anonymous_article',
66 'value' => serialize(0),
69 'name' => 'comment_form_location_article',
70 'value' => serialize(1),
73 'name' => 'comment_preview_article',
74 'value' => serialize(0),
77 'name' => 'comment_subject_article',
78 'value' => serialize(1),
82 // The expected results.
83 $tests[0]['expected_data'] = [
85 'bundle' => 'comment_node_article',
86 'node_type' => 'article',
87 'default_mode' => '1',
90 'form_location' => '1',
93 'label' => 'Article comment',