Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / node / tests / src / Kernel / Plugin / migrate / source / d6 / ViewModeTest.php
1 <?php
2
3 namespace Drupal\Tests\node\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests D6 view mode source plugin.
9  *
10  * @covers \Drupal\node\Plugin\migrate\source\d6\ViewMode
11  *
12  * @group node
13  */
14 class ViewModeTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['node', 'user', 'migrate_drupal'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     $tests = [];
26
27     // The source data.
28     $tests[0]['source_data']['content_node_field_instance'] = [
29       [
30         'display_settings' => serialize([
31           'weight' => '31',
32           'parent' => '',
33           'label' => [
34             'format' => 'above',
35           ],
36           'teaser' => [
37             'format' => 'default',
38             'exclude' => 0,
39           ],
40           'full' => [
41             'format' => 'default',
42             'exclude' => 0,
43           ],
44           4 => [
45             'format' => 'default',
46             'exclude' => 0,
47           ],
48         ]),
49       ],
50     ];
51
52     // The expected results.
53     $tests[0]['expected_data'] = [
54       [
55         'entity_type' => 'node',
56         'view_mode' => '4',
57       ],
58       [
59         'entity_type' => 'node',
60         'view_mode' => 'teaser',
61       ],
62       [
63         'entity_type' => 'node',
64         'view_mode' => 'full',
65       ],
66     ];
67
68     return $tests;
69   }
70
71 }