function MigrationTest::successfulLookupDataProvider

Provides data for the successful lookup test.

Return value

array The data.

File

core/modules/migrate/tests/src/Unit/process/MigrationTest.php, line 158

Class

MigrationTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Migration @group migrate @group legacy

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function successfulLookupDataProvider() {
    return [
        'scalar_to_scalar' => [
            'source_ids' => [
                1,
            ],
            'destination_ids' => [
                3,
            ],
            'input_value' => 1,
            'expected_value' => 3,
        ],
        'scalar_to_array' => [
            'source_ids' => [
                1,
            ],
            'destination_ids' => [
                3,
                'foo',
            ],
            'input_value' => 1,
            'expected_value' => [
                3,
                'foo',
            ],
        ],
        'array_to_scalar' => [
            'source_ids' => [
                1,
                3,
            ],
            'destination_ids' => [
                'foo',
            ],
            'input_value' => [
                1,
                3,
            ],
            'expected_value' => 'foo',
        ],
        'array_to_array' => [
            'source_ids' => [
                1,
                3,
            ],
            'destination_ids' => [
                3,
                'foo',
            ],
            'input_value' => [
                1,
                3,
            ],
            'expected_value' => [
                3,
                'foo',
            ],
        ],
    ];
}

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