public function MigrationLookupTest::testNoSkipValid in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php \Drupal\Tests\migrate\Unit\process\MigrationLookupTest::testNoSkipValid()
- 10 core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php \Drupal\Tests\migrate\Unit\process\MigrationLookupTest::testNoSkipValid()
Tests that valid, but technically empty values are not skipped.
@dataProvider noSkipValidDataProvider
Parameters
mixed $value: A valid value.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ MigrationLookupTest.php, line 111
Class
- MigrationLookupTest
- @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MigrationLookup @group migrate
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testNoSkipValid($value) {
$migration_plugin = $this
->prophesize(MigrationInterface::class);
$migration_plugin_manager = $this
->prophesize(MigrationPluginManagerInterface::class);
$id_map = $this
->prophesize(MigrateIdMapInterface::class);
$id_map
->lookupDestinationIds([
$value,
])
->willReturn([]);
$migration_plugin
->getIdMap()
->willReturn($id_map
->reveal());
$configuration = [
'migration' => 'foobaz',
'no_stub' => TRUE,
];
$migration_plugin
->id()
->willReturn(uniqid());
$migration_plugin_manager
->createInstances([
'foobaz',
])
->willReturn([
'foobaz' => $migration_plugin
->reveal(),
]);
$migration = MigrationLookup::create($this
->prepareContainer(), $configuration, '', [], $migration_plugin
->reveal());
$lookup = $migration
->transform($value, $this->migrateExecutable, $this->row, 'foo');
/* We provided no values and asked for no stub, so we should get NULL. */
$this
->assertNull($lookup);
}