function MigrationLookupTest::testMultipleSourceIds

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

Tests processing multiple source IDs.

File

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

Class

MigrationLookupTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MigrationLookup @group migrate

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testMultipleSourceIds() : void {
    $migration_plugin = $this->prophesize(MigrationInterface::class);
    $this->migrateLookup
        ->lookup('foo', [
        'id',
        6,
    ])
        ->willReturn([
        [
            2,
        ],
    ]);
    $configuration = [
        'migration' => 'foo',
    ];
    $migration = MigrationLookup::create($this->prepareContainer(), $configuration, '', [], $migration_plugin->reveal());
    $result = $migration->transform([
        'id',
        6,
    ], $this->migrateExecutable, $this->row, '');
    $this->assertEquals(2, $result);
}

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