Version 1
[yaffs-website] / web / core / modules / config_translation / tests / src / Kernel / Migrate / d6 / MigrateI18nUserProfileFieldInstanceTest.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  */
12 class MigrateI18nUserProfileFieldInstanceTest extends MigrateDrupal6TestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['config_translation', 'locale', 'language', 'field'];
18
19   /**
20    * Tests migration of translated user profile fields.
21    */
22   public function testUserProfileFields() {
23     $this->executeMigrations([
24       'user_profile_field',
25       'user_profile_field_instance',
26       'd6_i18n_user_profile_field_instance',
27     ]);
28     $language_manager = $this->container->get('language_manager');
29
30     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_love_migrations');
31     $this->assertSame("J'aime les migrations", $config_translation->get('label'));
32     $this->assertSame("Si vous cochez cette case, vous aimez les migrations.", $config_translation->get('description'));
33
34     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_color');
35     $this->assertSame('fr - Favorite color', $config_translation->get('label'));
36     $this->assertSame('Inscrivez votre couleur préférée', $config_translation->get('description'));
37
38     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_biography');
39     $this->assertSame('fr - Biography', $config_translation->get('label'));
40     $this->assertSame('fr - Tell people a little bit about yourself', $config_translation->get('description'));
41
42     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_sell_address');
43     $this->assertSame('fr - Sell your email address?', $config_translation->get('label'));
44     $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'));
45
46     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_sold_to');
47     $this->assertSame('fr - Sales Category', $config_translation->get('label'));
48     $this->assertSame("fr - Select the sales categories to which this user's address was sold.", $config_translation->get('description'));
49     $this->assertSame('fr - Pill spammers Fitness spammers Back\slash Forward/slash Dot.in.the.middle', $config_translation->get('options'));
50
51     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_bands');
52     $this->assertSame('Mes groupes préférés', $config_translation->get('label'));
53     $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'));
54
55     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_birthdate');
56     $this->assertSame('fr - Birthdate', $config_translation->get('label'));
57     $this->assertSame('fr - Enter your birth date and we\'ll send you a coupon.', $config_translation->get('description'));
58
59     $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_blog');
60     $this->assertSame('fr - Blog', $config_translation->get('label'));
61     $this->assertSame('fr - Paste the full URL, including http://, of your personal blog.', $config_translation->get('description'));
62   }
63
64 }