Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Unit / source / d6 / i18nVariableTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal\Unit\source\d6;
4
5 use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
6
7 /**
8  * Tests the variable source plugin.
9  *
10  * @group migrate_drupal
11  * @group legacy
12  */
13 class i18nVariableTest extends MigrateSqlSourceTestCase {
14
15   // The plugin system is not working during unit testing so the source plugin
16   // class needs to be manually specified.
17   const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable';
18
19   /**
20    * Define bare minimum migration configuration.
21    */
22   protected $migrationConfiguration = [
23     'id' => 'test',
24     'highWaterProperty' => ['field' => 'test'],
25     'source' => [
26       'plugin' => 'i18n_variable',
27       'variables' => [
28         'site_slogan',
29         'site_name',
30       ],
31     ],
32   ];
33
34   /**
35    * Expected results from the source.
36    */
37   protected $expectedResults = [
38     [
39       'language' => 'fr',
40       'site_slogan' => 'Migrate est génial',
41       'site_name' => 'nom de site',
42     ],
43     [
44       'language' => 'mi',
45       'site_slogan' => 'Ko whakamataku heke',
46       'site_name' => 'ingoa_pae',
47     ]
48   ];
49
50   /**
51    * Database contents for tests.
52    */
53   protected $databaseContents = [
54     'i18n_variable' => [
55       ['name' => 'site_slogan', 'language' => 'fr', 'value' => 's:19:"Migrate est génial";'],
56       ['name' => 'site_name', 'language' => 'fr', 'value' => 's:11:"nom de site";'],
57       ['name' => 'site_slogan', 'language' => 'mi', 'value' => 's:19:"Ko whakamataku heke";'],
58       ['name' => 'site_name', 'language' => 'mi', 'value' => 's:9:"ingoa_pae";'],
59     ],
60   ];
61
62 }