function ExtractTest::multipleValueProviderSource
Provides multiple source data for "extract" process plugin test.
File
- 
              core/
modules/ migrate/ tests/ src/ Kernel/ process/ ExtractTest.php, line 83  
Class
- ExtractTest
 - Tests the extract process plugin.
 
Namespace
Drupal\Tests\migrate\Kernel\processCode
public 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.