d3229e420c50183c94ff24dcc2b254b393aed6ac
[yaffs-website] / web / core / modules / node / tests / src / Kernel / Plugin / migrate / source / d7 / NodeTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\node\Kernel\Plugin\migrate\source\d7;
4
5 /**
6  * Tests D7 node translation source plugin.
7  *
8  * @covers \Drupal\node\Plugin\migrate\source\d7\Node
9  *
10  * @group node
11  */
12 class NodeTranslationTest extends NodeTest {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['node', 'user', 'migrate_drupal'];
18
19   /**
20    * {@inheritdoc}
21    */
22   public function providerSource() {
23     // Get the source data from parent.
24     $tests = parent::providerSource();
25
26     // The expected results.
27     $tests[0]['expected_data'] = [
28       [
29         // Node fields.
30         'nid' => 7,
31         'vid' => 7,
32         'type' => 'article',
33         'language' => 'fr',
34         'title' => 'node title 5 (title_field)',
35         'node_uid' => 1,
36         'revision_uid' => 1,
37         'status' => 1,
38         'created' => 1279292908,
39         'changed' => 1279310993,
40         'comment' => 0,
41         'promote' => 1,
42         'sticky' => 0,
43         'tnid' => 6,
44         'translate' => 0,
45         // Node revision fields.
46         'log' => '',
47         'timestamp' => 1279310993,
48         'body' => [
49           [
50             'value' => 'fr - body 6',
51             'summary' => '',
52             'format' => 'filtered_html',
53           ],
54         ],
55       ],
56     ];
57
58     // Do an automatic count.
59     $tests[0]['expected_count'] = NULL;
60
61     // Set up source plugin configuration.
62     $tests[0]['configuration'] = [
63       'translations' => TRUE,
64     ];
65
66     return $tests;
67   }
68
69 }