01d5ec929d8aa8b5b2d0dc45afd43fc5ae9422fe
[yaffs-website] / web / core / modules / config_translation / tests / src / Kernel / Migrate / d6 / MigrateUserProfileFieldInstanceTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\config_translation\Kernel\Migrate\d6;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
6
7 /**
8  * Tests the user profile field instance migration.
9  *
10  * @group migrate_drupal_6
11  * @group legacy
12  */
13 class MigrateUserProfileFieldInstanceTranslationTest extends MigrateDrupal6TestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['config_translation', 'locale', 'language', 'field'];
19
20   /**
21    * Tests migration of translated user profile fields.
22    */
23   public function testUserProfileFields() {
24     $this->executeMigrations([
25       'user_profile_field',
26       'user_profile_field_instance',
27       'd6_user_profile_field_instance_translation',
28     ]);
29     $language_manager = $this->container->get('language_manager');
30
31     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_love_migrations');
32     $this->assertSame("J'aime les migrations", $config_translation->get('label'));
33     $this->assertSame("Si vous cochez cette case, vous aimez les migrations.", $config_translation->get('description'));
34
35     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_color');
36     $this->assertSame('fr - Favorite color', $config_translation->get('label'));
37     $this->assertSame('Inscrivez votre couleur préférée', $config_translation->get('description'));
38
39     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_biography');
40     $this->assertSame('fr - Biography', $config_translation->get('label'));
41     $this->assertSame('fr - Tell people a little bit about yourself', $config_translation->get('description'));
42
43     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_sell_address');
44     $this->assertSame('fr - Sell your email address?', $config_translation->get('label'));
45     $this->assertSame("fr - If you check this box, we'll sell your address to spammers to help line the pockets of our shareholders. Thanks!", $config_translation->get('description'));
46
47     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_sold_to');
48     $this->assertSame('fr - Sales Category', $config_translation->get('label'));
49     $this->assertSame("fr - Select the sales categories to which this user's address was sold.", $config_translation->get('description'));
50     $this->assertSame('fr - Pill spammers Fitness spammers Back\slash Forward/slash Dot.in.the.middle', $config_translation->get('options'));
51
52     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_bands');
53     $this->assertSame('Mes groupes préférés', $config_translation->get('label'));
54     $this->assertSame("fr - Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites.", $config_translation->get('description'));
55
56     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_birthdate');
57     $this->assertSame('fr - Birthdate', $config_translation->get('label'));
58     $this->assertSame('fr - Enter your birth date and we\'ll send you a coupon.', $config_translation->get('description'));
59
60     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_blog');
61     $this->assertSame('fr - Blog', $config_translation->get('label'));
62     $this->assertSame('fr - Paste the full URL, including http://, of your personal blog.', $config_translation->get('description'));
63   }
64
65 }