Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Kernel / Plugin / migrate / source / d6 / i18nVariableTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests the variable source plugin.
9  *
10  * @covers \Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable
11  *
12  * @group migrate_drupal
13  * @group legacy
14  */
15 class i18nVariableTest extends MigrateSqlSourceTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public static $modules = ['migrate_drupal'];
21
22   /**
23    * {@inheritdoc}
24    */
25   public function providerSource() {
26     $tests = [];
27
28     // The source data.
29     $tests[0]['source_data']['i18n_variable'] = [
30       [
31         'name' => 'site_slogan',
32         'language' => 'fr',
33         'value' => 's:19:"Migrate est génial";',
34       ],
35       [
36         'name' => 'site_name',
37         'language' => 'fr',
38         'value' => 's:11:"nom de site";',
39       ],
40       [
41         'name' => 'site_slogan',
42         'language' => 'mi',
43         'value' => 's:19:"Ko whakamataku heke";',
44       ],
45       [
46         'name' => 'site_name',
47         'language' => 'mi',
48         'value' => 's:9:"ingoa_pae";',
49       ],
50     ];
51
52     // The expected results.
53     $tests[0]['expected_data'] = [
54       [
55         'language' => 'fr',
56         'site_slogan' => 'Migrate est génial',
57         'site_name' => 'nom de site',
58       ],
59       [
60         'language' => 'mi',
61         'site_slogan' => 'Ko whakamataku heke',
62         'site_name' => 'ingoa_pae',
63       ],
64     ];
65
66     // The expected count.
67     $tests[0]['expected_count'] = NULL;
68
69     // The migration configuration.
70     $tests[0]['configuration']['variables'] = [
71       'site_slogan',
72       'site_name',
73     ];
74
75     return $tests;
76   }
77
78 }