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 / d6 / CommentTest.php
1 <?php
2
3 namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests D6 comment source plugin.
9  *
10  * @covers \Drupal\comment\Plugin\migrate\source\d6\Comment
11  * @group comment
12  */
13 class CommentTest 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']['comments'] = [
28       [
29         'cid' => 1,
30         'pid' => 0,
31         'nid' => 2,
32         'uid' => 3,
33         'subject' => 'subject value 1',
34         'comment' => 'comment value 1',
35         'hostname' => 'hostname value 1',
36         'timestamp' => 1382255613,
37         'status' => 0,
38         'thread' => '',
39         'name' => '',
40         'mail' => '',
41         'homepage' => '',
42         'format' => 'testformat1',
43         'type' => 'story',
44       ],
45       [
46         'cid' => 2,
47         'pid' => 1,
48         'nid' => 3,
49         'uid' => 4,
50         'subject' => 'subject value 2',
51         'comment' => 'comment value 2',
52         'hostname' => 'hostname value 2',
53         'timestamp' => 1382255662,
54         'status' => 0,
55         'thread' => '',
56         'name' => '',
57         'mail' => '',
58         'homepage' => '',
59         'format' => 'testformat2',
60         'type' => 'page',
61       ],
62     ];
63
64     $tests[0]['source_data']['node'] = [
65       [
66         'nid' => 2,
67         'type' => 'story',
68         'language' => 'en',
69       ],
70       [
71         'nid' => 3,
72         'type' => 'page',
73         'language' => 'fr',
74       ],
75     ];
76
77     // The expected results.
78     $tests[0]['expected_data'] = [
79       [
80         'cid' => 1,
81         'pid' => 0,
82         'nid' => 2,
83         'uid' => 3,
84         'subject' => 'subject value 1',
85         'comment' => 'comment value 1',
86         'hostname' => 'hostname value 1',
87         'timestamp' => 1382255613,
88         'status' => 1,
89         'thread' => '',
90         'name' => '',
91         'mail' => '',
92         'homepage' => '',
93         'format' => 'testformat1',
94         'type' => 'story',
95         'language' => 'en',
96       ],
97       [
98         'cid' => 2,
99         'pid' => 1,
100         'nid' => 3,
101         'uid' => 4,
102         'subject' => 'subject value 2',
103         'comment' => 'comment value 2',
104         'hostname' => 'hostname value 2',
105         'timestamp' => 1382255662,
106         'status' => 1,
107         'thread' => '',
108         'name' => '',
109         'mail' => '',
110         'homepage' => '',
111         'format' => 'testformat2',
112         'type' => 'page',
113         'language' => 'fr',
114       ],
115     ];
116
117     return $tests;
118   }
119
120 }