function ProfileFieldTranslationTest::providerSource

Same name in other branches
  1. 9 core/modules/config_translation/tests/src/Kernel/Plugin/migrate/source/d6/ProfileFieldTranslationTest.php \Drupal\Tests\config_translation\Kernel\Plugin\migrate\source\d6\ProfileFieldTranslationTest::providerSource()
  2. 8.9.x core/modules/config_translation/tests/src/Kernel/Plugin/migrate/source/d6/ProfileFieldTranslationTest.php \Drupal\Tests\config_translation\Kernel\Plugin\migrate\source\d6\ProfileFieldTranslationTest::providerSource()
  3. 11.x core/modules/config_translation/tests/src/Kernel/Plugin/migrate/source/d6/ProfileFieldTranslationTest.php \Drupal\Tests\config_translation\Kernel\Plugin\migrate\source\d6\ProfileFieldTranslationTest::providerSource()

File

core/modules/config_translation/tests/src/Kernel/Plugin/migrate/source/d6/ProfileFieldTranslationTest.php, line 27

Class

ProfileFieldTranslationTest
Tests the i18nProfileField source plugin.

Namespace

Drupal\Tests\config_translation\Kernel\Plugin\migrate\source\d6

Code

public static function providerSource() {
    $test = [];
    $test[0]['source_data'] = [
        'profile_fields' => [
            [
                'fid' => 2,
                'title' => 'Test',
                'name' => 'profile_test',
            ],
            [
                'fid' => 42,
                'title' => 'I love migrations',
                'name' => 'profile_love_migrations',
            ],
        ],
        'i18n_strings' => [
            [
                'lid' => 1,
                'objectid' => 'profile_test',
                'type' => 'field',
                'property' => 'explanation',
            ],
            [
                'lid' => 10,
                'objectid' => 'profile_love_migrations',
                'type' => 'field',
                'property' => 'title',
            ],
            [
                'lid' => 11,
                'objectid' => 'profile_love_migrations',
                'type' => 'field',
                'property' => 'explanation',
            ],
        ],
        'locales_target' => [
            [
                'lid' => 10,
                'translation' => "fr - I love migration.",
                'language' => 'fr',
            ],
            [
                'lid' => 11,
                'translation' => 'fr - If you check this box, you like migrations.',
                'language' => 'fr',
            ],
        ],
    ];
    $test[0]['expected_data'] = [
        [
            'property' => 'title',
            'translation' => "fr - I love migration.",
            'language' => 'fr',
            'fid' => '42',
            'name' => 'profile_love_migrations',
        ],
        [
            'property' => 'explanation',
            'translation' => 'fr - If you check this box, you like migrations.',
            'language' => 'fr',
            'fid' => '42',
            'name' => 'profile_love_migrations',
        ],
    ];
    return $test;
}

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