function FieldInstanceLabelDescriptionTranslationTest::providerSource

Same name in this branch
  1. 8.9.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstanceLabelDescriptionTranslationTest::providerSource()
Same name in other branches
  1. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstanceLabelDescriptionTranslationTest::providerSource()
  2. 9 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstanceLabelDescriptionTranslationTest::providerSource()
  3. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstanceLabelDescriptionTranslationTest::providerSource()
  4. 10 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstanceLabelDescriptionTranslationTest::providerSource()
  5. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d6\FieldInstanceLabelDescriptionTranslationTest::providerSource()
  6. 11.x core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldInstanceLabelDescriptionTranslationTest.php \Drupal\Tests\field\Kernel\Plugin\migrate\source\d7\FieldInstanceLabelDescriptionTranslationTest::providerSource()

Overrides MigrateSourceTestBase::providerSource

File

core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php, line 23

Class

FieldInstanceLabelDescriptionTranslationTest
Tests the field label and description translation source plugin.

Namespace

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

Code

public function providerSource() {
    $test = [];
    // The source data.
    $test[0]['source_data'] = [
        'i18n_strings' => [
            [
                'lid' => 10,
                'objectid' => 'story-field_test_two',
                'type' => 'field',
                'property' => 'widget_label',
            ],
            [
                'lid' => 11,
                'objectid' => 'story-field_test_two',
                'type' => 'field',
                'property' => 'widget_description',
            ],
            [
                'lid' => 12,
                'objectid' => 'story-field_test_two',
                'type' => 'field',
                'property' => 'widget_description',
            ],
        ],
        'locales_target' => [
            [
                'lid' => 10,
                'translation' => "fr - Integer Field",
                'language' => 'fr',
            ],
            [
                'lid' => 11,
                'translation' => 'fr - An example integer field.',
                'language' => 'fr',
            ],
        ],
    ];
    $test[0]['expected_results'] = [
        [
            'property' => 'widget_label',
            'translation' => "fr - Integer Field",
            'language' => 'fr',
            'lid' => '10',
        ],
        [
            'property' => 'widget_description',
            'translation' => 'fr - An example integer field.',
            'language' => 'fr',
            'lid' => '11',
        ],
    ];
    return $test;
}

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