function RowTest::getMultipleDataProvider

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::getMultipleDataProvider()
  2. 10 core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::getMultipleDataProvider()
  3. 11.x core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::getMultipleDataProvider()

Data Provider for testGetMultiple.

Return value

array The keys and expected values.

File

core/modules/migrate/tests/src/Unit/RowTest.php, line 378

Class

RowTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21migrate%21src%21Row.php/class/Row/8.9.x" title="Stores a row." class="local">\Drupal\migrate\Row</a> @group migrate

Namespace

Drupal\Tests\migrate\Unit

Code

public function getMultipleDataProvider() {
    return [
        'Single Key' => [
            'keys' => [
                'source_key_1',
            ],
            'values' => [
                'source_value_1',
            ],
        ],
        'All Source Keys' => [
            'keys' => [
                'source_key_1',
                'source_key_2',
                '@@source_key_3',
            ],
            'values' => [
                'source_value_1',
                'source_value_2',
                'source_value_3',
            ],
        ],
        'All Destination Keys' => [
            'keys' => [
                '@destination_key_1',
                '@destination_key_2',
                '@@@destination_key_3',
            ],
            'values' => [
                'destination_value_1',
                'destination_value_2',
                'destination_value_3',
            ],
        ],
        'Mix of keys including non-existent' => [
            'keys' => [
                'shared_key_1',
                '@shared_key_1',
                '@@shared_key_2',
                '@@@shared_key_2',
                '@@@@@@@@@shared_key_3',
                'non_existent_source_key',
                '@non_existent_destination_key',
            ],
            'values' => [
                'source_shared_value_1',
                'destination_shared_value_1',
                'source_shared_value_2',
                'destination_shared_value_2',
                'destination_shared_value_3',
                NULL,
                NULL,
            ],
        ],
    ];
}

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