Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / comment / tests / src / Kernel / Plugin / migrate / source / d7 / CommentTypeTest.php
1 <?php
2
3 namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests D7 comment type source plugin.
9  *
10  * @covers \Drupal\comment\Plugin\migrate\source\d7\CommentType
11  * @group comment
12  */
13 class CommentTypeTest extends MigrateSqlSourceTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['comment', 'migrate_drupal'];
19
20   /**
21    * {@inheritdoc}
22    */
23   public function providerSource() {
24     $tests = [];
25
26     // The source data.
27     $tests[0]['source_data']['node_type'] = [
28       [
29         'type' => 'article',
30         'name' => 'Article',
31         'base' => 'node_content',
32         'module' => 'node',
33         'description' => 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.',
34         'help' => 'Help text for articles',
35         'has_title' => '1',
36         'title_label' => 'Title',
37         'custom' => '1',
38         'modified' => '1',
39         'locked' => '0',
40         'disabled' => '0',
41         'orig_type' => 'article',
42       ],
43     ];
44     $tests[0]['source_data']['field_config_instance'] = [
45       [
46         'id' => '14',
47         'field_id' => '1',
48         'field_name' => 'comment_body',
49         'entity_type' => 'comment',
50         'bundle' => 'comment_node_article',
51         'data' => 'a:0:{}',
52         'deleted' => '0',
53       ],
54     ];
55     $tests[0]['source_data']['variable'] = [
56       [
57         'name' => 'comment_default_mode_article',
58         'value' => serialize(1),
59       ],
60       [
61         'name' => 'comment_per_page_article',
62         'value' => serialize(50),
63       ],
64       [
65         'name' => 'comment_anonymous_article',
66         'value' => serialize(0),
67       ],
68       [
69         'name' => 'comment_form_location_article',
70         'value' => serialize(1),
71       ],
72       [
73         'name' => 'comment_preview_article',
74         'value' => serialize(0),
75       ],
76       [
77         'name' => 'comment_subject_article',
78         'value' => serialize(1),
79       ],
80     ];
81
82     // The expected results.
83     $tests[0]['expected_data'] = [
84       [
85         'bundle' => 'comment_node_article',
86         'node_type' => 'article',
87         'default_mode' => '1',
88         'per_page' => '50',
89         'anonymous' => '0',
90         'form_location' => '1',
91         'preview' => '0',
92         'subject' => '1',
93         'label' => 'Article comment',
94       ],
95     ];
96     return $tests;
97   }
98
99 }