Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / field / tests / src / Kernel / Plugin / migrate / source / d6 / FieldInstancePerFormDisplayTest.php
1 <?php
2
3 namespace Drupal\Tests\field\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests d6_field_instance_per_form_display source plugin.
9  *
10  * @covers \Drupal\field\Plugin\migrate\source\d6\FieldInstancePerFormDisplay
11  * @group field
12  */
13 class FieldInstancePerFormDisplayTest extends MigrateSqlSourceTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['field', 'migrate_drupal'];
19
20   /**
21    * {@inheritdoc}
22    */
23   public function providerSource() {
24     $tests = [
25       [
26         'source_data' => [],
27         'expected_data' => [],
28       ],
29     ];
30
31     // The expected results.
32     $tests[0]['expected_data'] = [
33       [
34         'display_settings' => [],
35         'widget_settings' => [],
36         'type_name' => 'story',
37         'widget_active' => TRUE,
38         'field_name' => 'field_test_filefield',
39         'type' => 'filefield',
40         'module' => 'filefield',
41         'weight' => '8',
42         'widget_type' => 'filefield_widget',
43       ],
44     ];
45
46     // The source data.
47     $empty_array = serialize([]);
48     $tests[0]['source_data']['content_node_field'] = [
49       [
50         'field_name' => 'field_test_filefield',
51         'type' => 'filefield',
52         'global_settings' => $empty_array,
53         'required' => '0',
54         'multiple' => '0',
55         'db_storage' => '1',
56         'module' => 'filefield',
57         'db_columns' => $empty_array,
58         'active' => '1',
59         'locked' => '0',
60       ],
61     ];
62     $tests[0]['source_data']['content_node_field_instance'] = [
63       [
64         'field_name' => 'field_test_filefield',
65         'type_name' => 'story',
66         'weight' => '8',
67         'label' => 'File Field',
68         'widget_type' => 'filefield_widget',
69         'widget_settings' => $empty_array,
70         'display_settings' => $empty_array,
71         'description' => 'An example image field.',
72         'widget_module' => 'filefield',
73         'widget_active' => '1',
74       ],
75     ];
76
77     return $tests;
78   }
79
80 }