function MigrationLookupTest::successfulLookupDataProvider

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

Provides data for the successful lookup test.

Return value

array The data.

File

core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php, line 216

Class

MigrationLookupTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21migrate%21src%21Plugin%21migrate%21process%21MigrationLookup.php/class/MigrationLookup/11.x" title="Looks up the value of a property based on a previous migration." class="local">\Drupal\migrate\Plugin\migrate\process\MigrationLookup</a> @group migrate

Namespace

Drupal\Tests\migrate\Unit\process

Code

public static function successfulLookupDataProvider() {
    return [
        // Test data for scalar to scalar.
[
            // Source ID of the migration map.
[
                1,
            ],
            // Destination ID of the migration map.
[
                3,
            ],
            // Input value for the migration plugin.
1,
            // Expected output value of the migration plugin.
3,
        ],
        // Test 0 as data source ID.
[
            // Source ID of the migration map.
[
                0,
            ],
            // Destination ID of the migration map.
[
                3,
            ],
            // Input value for the migration plugin.
0,
            // Expected output value of the migration plugin.
3,
        ],
        // Test data for scalar to array.
[
            // Source ID of the migration map.
[
                1,
            ],
            // Destination IDs of the migration map.
[
                3,
                'foo',
            ],
            // Input value for the migration plugin.
1,
            // Expected output values of the migration plugin.
[
                3,
                'foo',
            ],
        ],
        // Test data for array to scalar.
[
            // Source IDs of the migration map.
[
                1,
                3,
            ],
            // Destination ID of the migration map.
[
                'foo',
            ],
            // Input values for the migration plugin.
[
                1,
                3,
            ],
            // Expected output value of the migration plugin.
'foo',
        ],
        // Test data for array to array.
[
            // Source IDs of the migration map.
[
                1,
                3,
            ],
            // Destination IDs of the migration map.
[
                3,
                'foo',
            ],
            // Input values for the migration plugin.
[
                1,
                3,
            ],
            // Expected output values of the migration plugin.
[
                3,
                'foo',
            ],
        ],
    ];
}

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