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 / d7 / VariableTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\d7;
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\d7\VariableTranslation
11  *
12  * @group migrate_drupal
13  */
14 class VariableTranslationTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['migrate_drupal'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     $tests = [];
26
27     // The source data.
28     $tests[0]['source_data']['variable_store'] = [
29       [
30         'realm' => 'language',
31         'realm_key' => 'fr',
32         'name' => 'site_slogan',
33         'value' => 'fr - site slogan',
34         'serialized' => '0',
35       ],
36       [
37         'realm' => 'language',
38         'realm_key' => 'fr',
39         'name' => 'user_mail_status_blocked_subject',
40         'value' => 'fr - BEGONE!',
41         'serialized' => '0',
42       ],
43       [
44         'realm' => 'language',
45         'realm_key' => 'is',
46         'name' => 'site_slogan',
47         'value' => 's:16:"is - site slogan";',
48         'serialized' => '1',
49       ],
50     ];
51
52     // The expected results.
53     $tests[0]['expected_data'] = [
54       [
55         'language' => 'fr',
56         'site_slogan' => 'fr - site slogan',
57         'user_mail_status_blocked_subject' => 'fr - BEGONE!',
58       ],
59       [
60         'language' => 'is',
61         'site_slogan' => 'is - site slogan',
62       ],
63     ];
64
65     // The expected count.
66     $tests[0]['expected_count'] = NULL;
67
68     // The migration configuration.
69     $tests[0]['configuration']['variables'] = [
70       'site_slogan',
71       'user_mail_status_blocked_subject',
72     ];
73
74     return $tests;
75   }
76
77 }