c13a1b73f235ccba9287388f9ac4fe282aba6898
[yaffs-website] / web / core / modules / config_translation / tests / src / Kernel / Plugin / migrate / source / d6 / I18nProfileFieldTest.php
1 <?php
2
3 namespace Drupal\Tests\config_translation\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests the i18nProfileField source plugin.
9  *
10  * @covers \Drupal\config_translation\Plugin\migrate\source\d6\I18nProfileField
11  * @group migrate_drupal
12  * @group legacy
13  */
14 class I18nProfileFieldTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['config_translation', 'migrate_drupal', 'user'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     $test = [];
26     $test[0]['source_data'] = [
27       'profile_fields' => [
28         [
29           'fid' => 42,
30           'title' => 'I love migrations',
31           'name' => 'profile_love_migrations',
32         ],
33       ],
34       'i18n_strings' => [
35         [
36           'lid' => 10,
37           'objectid' => 'profile_love_migrations',
38           'type' => 'field',
39           'property' => 'title',
40         ],
41         [
42           'lid' => 11,
43           'objectid' => 'profile_love_migrations',
44           'type' => 'field',
45           'property' => 'explanation',
46         ],
47       ],
48       'locales_target' => [
49         [
50           'lid' => 10,
51           'translation' => "J'aime les migrations.",
52           'language' => 'fr',
53         ],
54         [
55           'lid' => 11,
56           'translation' => 'Si vous cochez cette case, vous aimez les migrations.',
57           'language' => 'fr',
58         ],
59       ],
60     ];
61     $test[0]['expected_results'] = [
62       [
63         'property' => 'title',
64         'translation' => "J'aime les migrations.",
65         'language' => 'fr',
66         'fid' => '42',
67         'name' => 'profile_love_migrations',
68       ],
69       [
70         'property' => 'explanation',
71         'translation' => 'Si vous cochez cette case, vous aimez les migrations.',
72         'language' => 'fr',
73         'fid' => '42',
74         'name' => 'profile_love_migrations',
75       ],
76     ];
77     return $test;
78   }
79
80 }