function MigrateUserProfileFieldInstanceTranslationTest::testUserProfileFields

Same name in other branches
  1. 9 core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateUserProfileFieldInstanceTranslationTest::testUserProfileFields()
  2. 8.9.x core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateUserProfileFieldInstanceTranslationTest::testUserProfileFields()
  3. 10 core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateUserProfileFieldInstanceTranslationTest::testUserProfileFields()

Tests migration of translated user profile fields.

File

core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php, line 29

Class

MigrateUserProfileFieldInstanceTranslationTest
Tests the user profile field instance migration.

Namespace

Drupal\Tests\config_translation\Kernel\Migrate\d6

Code

public function testUserProfileFields() : void {
    $this->executeMigrations([
        'language',
        'user_profile_field',
        'user_profile_field_instance',
        'd6_user_profile_field_instance_translation',
    ]);
    $language_manager = $this->container
        ->get('language_manager');
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_really_really_love_mig');
    $this->assertSame("J'aime les migrations", $config_translation->get('label'));
    $this->assertSame("Si vous cochez cette case, vous aimez les migrations.", $config_translation->get('description'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_color');
    $this->assertSame('fr - Favorite color', $config_translation->get('label'));
    $this->assertSame('Inscrivez votre couleur préférée', $config_translation->get('description'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_biography');
    $this->assertSame('fr - Biography', $config_translation->get('label'));
    $this->assertSame('fr - Tell people a little bit about yourself', $config_translation->get('description'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_sell_address');
    $this->assertSame('fr - Sell your email address?', $config_translation->get('label'));
    $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'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_sold_to');
    $this->assertSame('fr - Sales Category', $config_translation->get('label'));
    $this->assertSame("fr - Select the sales categories to which this user's address was sold.", $config_translation->get('description'));
    $this->assertSame('fr - Pill spammers Fitness spammers Back\\slash Forward/slash Dot.in.the.middle', $config_translation->get('options'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_bands');
    $this->assertSame('Mes groupes préférés', $config_translation->get('label'));
    $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'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_birthdate');
    $this->assertSame('fr - Birthdate', $config_translation->get('label'));
    $this->assertSame('fr - Enter your birth date and we\'ll send you a coupon.', $config_translation->get('description'));
    $config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.field.user.user.profile_blog');
    $this->assertSame('fr - Blog', $config_translation->get('label'));
    $this->assertSame('fr - Paste the full URL, including http://, of your personal blog.', $config_translation->get('description'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.