class MigrateProfileFieldOptionTranslationTest
Same name and namespace in other branches
- 11.x core/modules/user/tests/src/Kernel/Migrate/d6/MigrateProfileFieldOptionTranslationTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateProfileFieldOptionTranslationTest
Tests field option translations migration.
@group migrate_drupal_6
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\user\Kernel\Migrate\d6\MigrateProfileFieldOptionTranslationTest implements \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateProfileFieldOptionTranslationTest
File
-
core/
modules/ user/ tests/ src/ Kernel/ Migrate/ d6/ MigrateProfileFieldOptionTranslationTest.php, line 12
Namespace
Drupal\Tests\user\Kernel\Migrate\d6View source
class MigrateProfileFieldOptionTranslationTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'config_translation',
'language',
'locale',
'menu_ui',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->executeMigrations([
'language',
'user_profile_field',
'user_profile_field_instance',
'd6_profile_field_option_translation',
]);
}
/**
* Tests the Drupal 6 field option translation.
*/
public function testFieldOptionTranslation() {
$language_manager = $this->container
->get('language_manager');
/** @var \Drupal\language\Config\LanguageConfigOverride $config_translation */
$config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.storage.user.profile_count_trees');
$allowed_values = [
0 => [
'label' => 'fr - 10',
],
1 => [
'label' => 'fr - 20',
],
2 => [
'label' => 'fr - 50',
],
3 => [
'label' => 'fr - 100',
],
4 => [
'label' => 'fr - 1000',
],
];
$this->assertSame($allowed_values, $config_translation->get('settings.allowed_values'));
$config_translation = $language_manager->getLanguageConfigOverride('fr', 'field.storage.user.profile_sold_to');
$allowed_values = [
[
'label' => 'fr - Pill spammers Fitness spammers Back\\slash Forward/slash Dot.in.the.middle',
],
];
$this->assertSame($allowed_values, $config_translation->get('settings.allowed_values'));
$config_translation = $language_manager->getLanguageConfigOverride('zu', 'field.storage.user.profile_sold_to');
$allowed_values = [
[
'label' => 'zu - Pill spammers Fitness spammers Back\\slash Forward/slash Dot.in.the.middle',
],
];
$this->assertSame($allowed_values, $config_translation->get('settings.allowed_values'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.