function MigrationTest::testTransformWithStubSkipping

Tests a lookup with no stubbing.

@covers ::transform

@expectedDeprecation Not passing the migrate lookup service as the fifth parameter to Drupal\migrate\Plugin\migrate\process\MigrationLookup::__construct is deprecated in drupal:8.8.0 and will throw a type error in drupal:9.0.0. Pass an instance of \Drupal\migrate\MigrateLookupInterface. See https://www.drupal.org/node/3047268 @expectedDeprecation Not passing the migrate stub service as the sixth parameter to Drupal\migrate\Plugin\migrate\process\MigrationLookup::__construct is deprecated in drupal:8.8.0 and will throw a type error in drupal:9.0.0. Pass an instance of \Drupal\migrate\MigrateStubInterface. See https://www.drupal.org/node/3047268

File

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

Class

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

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testTransformWithStubSkipping() {
    $configuration = [
        'no_stub' => TRUE,
        'migration' => 'destination_migration',
    ];
    $this->migrateLookup
        ->lookup('destination_migration', [
        1,
    ])
        ->willReturn([]);
    $this->prepareContainer();
    $migration = new Migration($configuration, '', [], $this->migration_plugin
        ->reveal(), $this->migration_plugin_manager
        ->reveal(), $this->process_plugin_manager
        ->reveal());
    $result = $migration->transform(1, $this->migrateExecutable, $this->row, '');
    $this->assertNull($result);
}

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