protected function MigrationTest::getMigration in Drupal 8
Creates a mock Migration instance.
Return value
\Prophecy\Prophecy\ObjectProphecy A mock Migration instance.
Overrides MigrateTestCase::getMigration
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ MigrationTest.php, line 94
Class
- MigrationTest
- @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Migration @group migrate @group legacy
Namespace
Drupal\Tests\migrate\Unit\processCode
protected function getMigration() {
$id_map = $this
->prophesize(MigrateIdMapInterface::class);
$id_map
->lookupDestinationIds([
1,
])
->willReturn(NULL);
$id_map
->saveIdMapping(Argument::any(), Argument::any(), MigrateIdMapInterface::STATUS_NEEDS_UPDATE)
->willReturn(NULL);
$migration = $this
->prophesize(MigrationInterface::class);
$migration
->getIdMap()
->willReturn($id_map
->reveal());
return $migration;
}