Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / config_translation / tests / src / Kernel / Plugin / migrate / source / d6 / ProfileFieldTranslationTest.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\ProfileFieldTranslation
11  * @group migrate_drupal
12  */
13 class ProfileFieldTranslationTest extends MigrateSqlSourceTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['config_translation', 'migrate_drupal', 'user'];
19
20   /**
21    * {@inheritdoc}
22    */
23   public function providerSource() {
24     $test = [];
25     $test[0]['source_data'] = [
26       'profile_fields' => [
27         [
28           'fid' => 42,
29           'title' => 'I love migrations',
30           'name' => 'profile_love_migrations',
31         ],
32       ],
33       'i18n_strings' => [
34         [
35           'lid' => 10,
36           'objectid' => 'profile_love_migrations',
37           'type' => 'field',
38           'property' => 'title',
39         ],
40         [
41           'lid' => 11,
42           'objectid' => 'profile_love_migrations',
43           'type' => 'field',
44           'property' => 'explanation',
45         ],
46       ],
47       'locales_target' => [
48         [
49           'lid' => 10,
50           'translation' => "J'aime les migrations.",
51           'language' => 'fr',
52         ],
53         [
54           'lid' => 11,
55           'translation' => 'Si vous cochez cette case, vous aimez les migrations.',
56           'language' => 'fr',
57         ],
58       ],
59     ];
60     $test[0]['expected_results'] = [
61       [
62         'property' => 'title',
63         'translation' => "J'aime les migrations.",
64         'language' => 'fr',
65         'fid' => '42',
66         'name' => 'profile_love_migrations',
67       ],
68       [
69         'property' => 'explanation',
70         'translation' => 'Si vous cochez cette case, vous aimez les migrations.',
71         'language' => 'fr',
72         'fid' => '42',
73         'name' => 'profile_love_migrations',
74       ],
75     ];
76     return $test;
77   }
78
79 }