function ExtractTest::multipleValueProviderSource

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/process/ExtractTest.php \Drupal\Tests\migrate\Kernel\process\ExtractTest::multipleValueProviderSource()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/process/ExtractTest.php \Drupal\Tests\migrate\Kernel\process\ExtractTest::multipleValueProviderSource()
  3. 11.x core/modules/migrate/tests/src/Kernel/process/ExtractTest.php \Drupal\Tests\migrate\Kernel\process\ExtractTest::multipleValueProviderSource()

Provides multiple source data for "extract" process plugin test.

File

core/modules/migrate/tests/src/Kernel/process/ExtractTest.php, line 85

Class

ExtractTest
Tests the extract process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

public static function multipleValueProviderSource() {
    $tests = [
        [
            'source_data' => [
                'id' => '1',
                'simple_array' => [
                    'alpha',
                    'beta',
                ],
                'complex_array' => [
                    [
                        'alpha',
                        'beta',
                    ],
                    [
                        'psi',
                        'omega',
                    ],
                ],
            ],
            'expected_data' => [
                'first' => 'alpha',
                'second' => [
                    'psi',
                    'omega',
                ],
            ],
        ],
        [
            'source_data' => [
                'id' => '2',
                'simple_array' => [
                    'one',
                ],
                'complex_array' => [
                    0,
                    1,
                ],
            ],
            'expected_data' => [
                'first' => 'one',
                'second' => 1,
            ],
        ],
    ];
    return $tests;
}

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